Terraria 1.3.5.3 Source Code

This commit is contained in:
MikeyIsBaeYT 2021-10-27 18:03:19 -04:00
commit 4b21dac4b6
503 changed files with 409032 additions and 0 deletions

View file

@ -0,0 +1,18 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.ChatCommandAttribute
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
using System;
namespace Terraria.Chat.Commands
{
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public sealed class ChatCommandAttribute : Attribute
{
public readonly string Name;
public ChatCommandAttribute(string name) => this.Name = name;
}
}

View file

@ -0,0 +1,25 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.EmoteCommand
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace Terraria.Chat.Commands
{
[ChatCommand("Emote")]
public class EmoteCommand : IChatCommand
{
private static readonly Color RESPONSE_COLOR = new Color(200, 100, 0);
public void ProcessMessage(string text, byte clientId)
{
if (!(text != ""))
return;
text = string.Format("*{0} {1}", (object) Main.player[(int) clientId].name, (object) text);
NetMessage.BroadcastChatMessage(NetworkText.FromLiteral(text), EmoteCommand.RESPONSE_COLOR);
}
}
}

View file

@ -0,0 +1,13 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.IChatCommand
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
namespace Terraria.Chat.Commands
{
public interface IChatCommand
{
void ProcessMessage(string text, byte clientId);
}
}

View file

@ -0,0 +1,22 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.ListPlayersCommand
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria.Localization;
namespace Terraria.Chat.Commands
{
[ChatCommand("Playing")]
public class ListPlayersCommand : IChatCommand
{
private static readonly Color RESPONSE_COLOR = new Color((int) byte.MaxValue, 240, 20);
public void ProcessMessage(string text, byte clientId) => NetMessage.SendChatMessageToClient(NetworkText.FromLiteral(string.Join(", ", ((IEnumerable<Player>) Main.player).Where<Player>((Func<Player, bool>) (player => player.active)).Select<Player, string>((Func<Player, string>) (player => player.name)))), ListPlayersCommand.RESPONSE_COLOR, (int) clientId);
}
}

View file

@ -0,0 +1,48 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.PartyChatCommand
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
using Microsoft.Xna.Framework;
using Terraria.GameContent.NetModules;
using Terraria.Localization;
using Terraria.Net;
namespace Terraria.Chat.Commands
{
[ChatCommand("Party")]
public class PartyChatCommand : IChatCommand
{
private static readonly Color ERROR_COLOR = new Color((int) byte.MaxValue, 240, 20);
public void ProcessMessage(string text, byte clientId)
{
int team = Main.player[(int) clientId].team;
Color color = Main.teamColor[team];
if (team == 0)
{
this.SendNoTeamError(clientId);
}
else
{
if (text == "")
return;
for (int playerId = 0; playerId < (int) byte.MaxValue; ++playerId)
{
if (Main.player[playerId].team == team)
{
NetPacket packet = NetTextModule.SerializeServerMessage(NetworkText.FromLiteral(text), color, clientId);
NetManager.Instance.SendToClient(packet, playerId);
}
}
}
}
private void SendNoTeamError(byte clientId)
{
NetPacket packet = NetTextModule.SerializeServerMessage(Lang.mp[10].ToNetworkText(), PartyChatCommand.ERROR_COLOR);
NetManager.Instance.SendToClient(packet, (int) clientId);
}
}
}

View file

@ -0,0 +1,25 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.RollCommand
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace Terraria.Chat.Commands
{
[ChatCommand("Roll")]
public class RollCommand : IChatCommand
{
private static readonly Color RESPONSE_COLOR = new Color((int) byte.MaxValue, 240, 20);
public string InternalName => "roll";
public void ProcessMessage(string text, byte clientId)
{
int num = Main.rand.Next(1, 101);
NetMessage.BroadcastChatMessage(NetworkText.FromFormattable("*{0} {1} {2}", (object) Main.player[(int) clientId].name, (object) Lang.mp[9].ToNetworkText(), (object) num), RollCommand.RESPONSE_COLOR);
}
}
}

View file

@ -0,0 +1,24 @@
// Decompiled with JetBrains decompiler
// Type: Terraria.Chat.Commands.SayChatCommand
// Assembly: Terraria, Version=1.3.5.3, Culture=neutral, PublicKeyToken=null
// MVID: 68659D26-2BE6-448F-8663-74FA559E6F08
// Assembly location: C:\Users\mikeyisbaeyt\Downloads\depotdownloader-2.4.5\depots\105601\6707058\Terraria.exe
using System;
using Terraria.GameContent.NetModules;
using Terraria.Localization;
using Terraria.Net;
namespace Terraria.Chat.Commands
{
[ChatCommand("Say")]
public class SayChatCommand : IChatCommand
{
public void ProcessMessage(string text, byte clientId)
{
NetPacket packet = NetTextModule.SerializeServerMessage(NetworkText.FromLiteral(text), Main.player[(int) clientId].ChatColor(), clientId);
NetManager.Instance.Broadcast(packet);
Console.WriteLine("<{0}> {1}", (object) Main.player[(int) clientId].name, (object) text);
}
}
}