Browse files

Fixed null reference exceptions in terraria

  • Loading branch information...
1 parent f425766 commit 86c184abd04811e31111db4484cd0159d52c5c94 high committed Aug 18, 2011
Showing with 29 additions and 3 deletions.
  1. +29 −3 TerrariaServer/TerrariaServer.il
View
32 TerrariaServer/TerrariaServer.il
@@ -19971,7 +19971,16 @@ call void [TerrariaServerAPI]TerrariaAPI.Hooks.ServerHooks::OnSocketReset(class
IL_0177: stloc.s V_4
IL_0179: br.s IL_019a
- IL_017b: ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
+ IL_017b:
+
+ ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
+ ldloc.s V_4 //CHANGE
+ ldelem.ref
+ ldfld class [System]System.Net.Sockets.TcpClient Terraria.ServerSock::tcpClient
+ callvirt instance class [System]System.Net.Sockets.Socket [System]System.Net.Sockets.TcpClient::get_Client()
+ brfalse IL_018f //CHANGE
+
+ ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
IL_0180: ldloc.s V_4
IL_0182: ldelem.ref
IL_0183: ldfld class [System]System.Net.Sockets.TcpClient Terraria.ServerSock::tcpClient
@@ -20068,7 +20077,15 @@ call void [TerrariaServerAPI]TerrariaAPI.Hooks.ServerHooks::OnSocketReset(class
IL_0240: call void Terraria.NetMessage::syncPlayers()
IL_0245: br IL_073a
- IL_024a: ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
+ IL_024a:
+ ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
+ ldloc.s V_6 //CHANGE
+ ldelem.ref
+ ldfld class [System]System.Net.Sockets.TcpClient Terraria.ServerSock::tcpClient
+ callvirt instance class [System]System.Net.Sockets.Socket [System]System.Net.Sockets.TcpClient::get_Client()
+ brfalse IL_06f2 //CHANGE
+
+ ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
IL_024f: ldloc.s V_6
IL_0251: ldelem.ref
IL_0252: ldfld class [System]System.Net.Sockets.TcpClient Terraria.ServerSock::tcpClient
@@ -20663,7 +20680,16 @@ call void [TerrariaServerAPI]TerrariaAPI.Hooks.ServerHooks::OnSocketReset(class
IL_0008: stloc.1
IL_0009: br.s IL_0026
- IL_000b: ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
+ IL_000b:
+
+ ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
+ ldloc.1 //CHANGE
+ ldelem.ref
+ ldfld class [System]System.Net.Sockets.TcpClient Terraria.ServerSock::tcpClient
+ callvirt instance class [System]System.Net.Sockets.Socket [System]System.Net.Sockets.TcpClient::get_Client()
+ brfalse IL_001e //CHANGE
+
+ ldsfld class Terraria.ServerSock[] Terraria.Netplay::serverSock
IL_0010: ldloc.1
IL_0011: ldelem.ref
IL_0012: ldfld class [System]System.Net.Sockets.TcpClient Terraria.ServerSock::tcpClient

0 comments on commit 86c184a

Please sign in to comment.