private static void ClientLoopSetup(RemoteAddress address)
 {
     Netplay.ResetNetDiag();
     Main.ServerSideCharacter = false;
     if (Main.rand == null)
     {
         Main.rand = new Random((int)DateTime.Now.Ticks);
     }
     if (WorldGen.genRand == null)
     {
         WorldGen.genRand = new Random((int)DateTime.Now.Ticks);
     }
     Main.player[Main.myPlayer].hostile = false;
     Main.clientPlayer = (Player)Main.player[Main.myPlayer].clientClone();
     for (int i = 0; i < 255; i++)
     {
         if (i != Main.myPlayer)
         {
             Main.player[i] = new Player();
         }
     }
     Main.netMode  = 1;
     Main.menuMode = 14;
     if (!Main.autoPass)
     {
         Main.statusText = "Connecting to " + address.GetFriendlyName();
     }
     Netplay.disconnect            = false;
     Netplay.Connection            = new RemoteServer();
     Netplay.Connection.ReadBuffer = new byte[1024];
 }
Exemple #2
0
 private static void ClientLoopSetup(RemoteAddress address)
 {
     Netplay.ResetNetDiag();
     Main.ServerSideCharacter = false;
     if (Main.rand == null)
     {
         Main.rand = new UnifiedRandom((int)DateTime.Now.Ticks);
     }
     Main.player[Main.myPlayer].hostile = false;
     Main.clientPlayer = (Player)Main.player[Main.myPlayer].clientClone();
     for (int index = 0; index < (int)byte.MaxValue; ++index)
     {
         if (index != Main.myPlayer)
         {
             Main.player[index] = new Player();
         }
     }
     Main.netMode  = 1;
     Main.menuMode = 14;
     if (!Main.autoPass)
     {
         Main.statusText = Language.GetTextValue("Net.ConnectingTo", (object)address.GetFriendlyName());
     }
     Netplay.disconnect            = false;
     Netplay.Connection            = new RemoteServer();
     Netplay.Connection.ReadBuffer = new byte[1024];
 }
Exemple #3
0
 private static void ClientLoopSetup(RemoteAddress address)
 {
     LogManager.GetLogger("Dimension Library Server").InfoFormat("Connecting to {0}", address.GetFriendlyName());
     Netplay.ResetNetDiag();
     Main.ServerSideCharacter = false;
     if (Main.rand == null)
     {
         Main.rand = new UnifiedRandom((int)DateTime.Now.Ticks);
     }
     Main.player[Main.myPlayer].hostile = false;
     Main.clientPlayer = (Player)Main.player[Main.myPlayer].clientClone();
     for (int i = 0; i < 255; i++)
     {
         if (i != Main.myPlayer)
         {
             Main.player[i] = new Player();
         }
     }
     Main.netMode                  = 1;
     Netplay.disconnect            = false;
     Netplay.Connection            = new RemoteServer();
     Netplay.Connection.ReadBuffer = new byte[ushort.MaxValue];
 }