Removed broken senddata hook.
This commit is contained in:
parent
3644719c1c
commit
fb0252ac7c
3 changed files with 2 additions and 166 deletions
|
|
@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
|
|||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("2.3.0.0623")]
|
||||
[assembly: AssemblyFileVersion("2.3.0.0623")]
|
||||
[assembly: AssemblyVersion("2.3.0.0624")]
|
||||
[assembly: AssemblyFileVersion("2.3.0.0624")]
|
||||
|
|
@ -142,7 +142,6 @@ namespace TShockAPI
|
|||
int spawnTileY = Main.spawnTileY;
|
||||
Main.spawnTileX = tileX;
|
||||
Main.spawnTileY = tileY;
|
||||
TShock.IsTP = true;
|
||||
NetMessage.SendData((int)PacketTypes.WorldInfo, Index, -1, "", 0, 0.0f, 0.0f, 0.0f);
|
||||
if (TPlayer.SpawnX >= 0 && TPlayer.SpawnY >= 0)
|
||||
{
|
||||
|
|
@ -160,7 +159,6 @@ namespace TShockAPI
|
|||
Main.spawnTileX = spawnTileX;
|
||||
Main.spawnTileY = spawnTileY;
|
||||
NetMessage.SendData((int)PacketTypes.WorldInfo, Index, -1, "", 0, 0.0f, 0.0f, 0.0f);
|
||||
TShock.IsTP = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,6 @@ namespace TShockAPI
|
|||
public static BanManager Bans = new BanManager(Path.Combine(SavePath, "bans.txt"));
|
||||
public static BackupManager Backups = new BackupManager(Path.Combine(SavePath, "backups"));
|
||||
|
||||
public static bool IsTP = false;
|
||||
|
||||
public override Version Version
|
||||
{
|
||||
get { return VersionNum; }
|
||||
|
|
@ -90,7 +88,6 @@ namespace TShockAPI
|
|||
ServerHooks.Command += ServerHooks_OnCommand;
|
||||
NetHooks.GetData += GetData;
|
||||
NetHooks.GreetPlayer += OnGreetPlayer;
|
||||
NetHooks.SendData += OnSendData;
|
||||
NpcHooks.StrikeNpc += NpcHooks_OnStrikeNpc;
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
|
@ -327,165 +324,6 @@ namespace TShockAPI
|
|||
}
|
||||
}
|
||||
|
||||
private void OnSendData(SendDataEventArgs e)
|
||||
{
|
||||
int remoteClient = 256;
|
||||
if (e.remoteClient >= 0)
|
||||
remoteClient = e.remoteClient;
|
||||
int num2 = 5;
|
||||
int num3 = num2;
|
||||
if (e.MsgID == PacketTypes.WorldInfo)
|
||||
{
|
||||
if (!IsTP)
|
||||
{
|
||||
byte[] bytes18 = BitConverter.GetBytes((int)e.MsgID);
|
||||
byte[] bytes19 = BitConverter.GetBytes((int)Main.time);
|
||||
byte b6 = 0;
|
||||
if (Main.dayTime)
|
||||
{
|
||||
b6 = 1;
|
||||
}
|
||||
byte b7 = (byte)Main.moonPhase;
|
||||
byte b8 = 0;
|
||||
if (Main.bloodMoon)
|
||||
{
|
||||
b8 = 1;
|
||||
}
|
||||
byte[] bytes20 = BitConverter.GetBytes(Main.maxTilesX);
|
||||
byte[] bytes21 = BitConverter.GetBytes(Main.maxTilesY);
|
||||
|
||||
|
||||
byte[] bytes22 = BitConverter.GetBytes(ConfigurationManager.spawnTileX);
|
||||
byte[] bytes23 = BitConverter.GetBytes(ConfigurationManager.spawnTileY);
|
||||
|
||||
byte[] bytes24 = BitConverter.GetBytes((int)Main.worldSurface);
|
||||
byte[] bytes25 = BitConverter.GetBytes((int)Main.rockLayer);
|
||||
byte[] bytes26 = BitConverter.GetBytes(Main.worldID);
|
||||
byte[] bytes27 = Encoding.ASCII.GetBytes(Main.worldName);
|
||||
byte b9 = 0;
|
||||
if (WorldGen.shadowOrbSmashed)
|
||||
{
|
||||
b9 += 1;
|
||||
}
|
||||
if (NPC.downedBoss1)
|
||||
{
|
||||
b9 += 2;
|
||||
}
|
||||
if (NPC.downedBoss2)
|
||||
{
|
||||
b9 += 4;
|
||||
}
|
||||
if (NPC.downedBoss3)
|
||||
{
|
||||
b9 += 8;
|
||||
}
|
||||
num2 += bytes19.Length + 1 + 1 + 1 + bytes20.Length + bytes21.Length + bytes22.Length + bytes23.Length + bytes24.Length + bytes25.Length + bytes26.Length + 1 + bytes27.Length;
|
||||
byte[] bytes28 = BitConverter.GetBytes(num2 - 4);
|
||||
Buffer.BlockCopy(bytes28, 0, NetMessage.buffer[remoteClient].writeBuffer, 0, 4);
|
||||
Buffer.BlockCopy(bytes18, 0, NetMessage.buffer[remoteClient].writeBuffer, 4, 1);
|
||||
Buffer.BlockCopy(bytes19, 0, NetMessage.buffer[remoteClient].writeBuffer, 5, bytes19.Length);
|
||||
num3 += bytes19.Length;
|
||||
NetMessage.buffer[remoteClient].writeBuffer[num3] = b6;
|
||||
num3++;
|
||||
NetMessage.buffer[remoteClient].writeBuffer[num3] = b7;
|
||||
num3++;
|
||||
NetMessage.buffer[remoteClient].writeBuffer[num3] = b8;
|
||||
num3++;
|
||||
Buffer.BlockCopy(bytes20, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes20.Length);
|
||||
num3 += bytes20.Length;
|
||||
Buffer.BlockCopy(bytes21, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes21.Length);
|
||||
num3 += bytes21.Length;
|
||||
Buffer.BlockCopy(bytes22, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes22.Length);
|
||||
num3 += bytes22.Length;
|
||||
Buffer.BlockCopy(bytes23, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes23.Length);
|
||||
num3 += bytes23.Length;
|
||||
Buffer.BlockCopy(bytes24, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes24.Length);
|
||||
num3 += bytes24.Length;
|
||||
Buffer.BlockCopy(bytes25, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes25.Length);
|
||||
num3 += bytes25.Length;
|
||||
Buffer.BlockCopy(bytes26, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes26.Length);
|
||||
num3 += bytes26.Length;
|
||||
NetMessage.buffer[remoteClient].writeBuffer[num3] = b9;
|
||||
num3++;
|
||||
Buffer.BlockCopy(bytes27, 0, NetMessage.buffer[remoteClient].writeBuffer, num3, bytes27.Length);
|
||||
num3 += bytes27.Length;
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
if (e.Handled)
|
||||
{
|
||||
if (Main.netMode != 1)
|
||||
{
|
||||
goto IL_34D2;
|
||||
}
|
||||
if (Netplay.clientSock.tcpClient.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
NetMessage.buffer[remoteClient].spamCount++;
|
||||
Netplay.clientSock.networkStream.BeginWrite(NetMessage.buffer[remoteClient].writeBuffer, 0, num2, new AsyncCallback(Netplay.clientSock.ClientWriteCallBack), Netplay.clientSock.networkStream);
|
||||
goto IL_3612;
|
||||
}
|
||||
catch
|
||||
{
|
||||
goto IL_3612;
|
||||
}
|
||||
goto IL_34D2;
|
||||
}
|
||||
IL_3612:
|
||||
if (Main.verboseNetplay)
|
||||
{
|
||||
for (int num10 = 0; num10 < num2; num10++)
|
||||
{
|
||||
}
|
||||
for (int num11 = 0; num11 < num2; num11++)
|
||||
{
|
||||
byte arg_3649_0 = NetMessage.buffer[remoteClient].writeBuffer[num11];
|
||||
}
|
||||
goto IL_365B;
|
||||
}
|
||||
goto IL_365B;
|
||||
IL_34D2:
|
||||
if (e.remoteClient == -1)
|
||||
{
|
||||
for (int num12 = 0; num12 < 256; num12++)
|
||||
{
|
||||
if (num12 != e.ignoreClient && (NetMessage.buffer[num12].broadcast || (Netplay.serverSock[num12].state >= 3 && (int)e.MsgID == 10)) && Netplay.serverSock[num12].tcpClient.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
NetMessage.buffer[num12].spamCount++;
|
||||
Netplay.serverSock[num12].networkStream.BeginWrite(NetMessage.buffer[remoteClient].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[num12].ServerWriteCallBack), Netplay.serverSock[num12].networkStream);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
goto IL_3612;
|
||||
}
|
||||
if (Netplay.serverSock[remoteClient].tcpClient.Connected)
|
||||
{
|
||||
try
|
||||
{
|
||||
NetMessage.buffer[remoteClient].spamCount++;
|
||||
Netplay.serverSock[remoteClient].networkStream.BeginWrite(NetMessage.buffer[remoteClient].writeBuffer, 0, num2, new AsyncCallback(Netplay.serverSock[remoteClient].ServerWriteCallBack), Netplay.serverSock[remoteClient].networkStream);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
goto IL_3612;
|
||||
}
|
||||
goto IL_3612;
|
||||
IL_365B:
|
||||
NetMessage.buffer[remoteClient].writeLocked = false;
|
||||
if ((int)e.MsgID == 2 && Main.netMode == 2)
|
||||
{
|
||||
Netplay.serverSock[remoteClient].kill = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When a server command is run.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue