Exemple #1
0
 /// <exception cref="System.IO.IOException"/>
 public NetworkManager(Socket socket, string s, net.minecraft.src.NetHandler nethandler)
 {
     // Referenced classes of package net.minecraft.src:
     //            NetworkReaderThread, NetworkWriterThread, Packet, NetHandler,
     //            NetworkMasterThread, ThreadMonitorConnection
     sendQueueLock        = new object();
     isRunning            = true;
     readPackets          = new ConcurrentQueue <Packet>();
     dataPackets          = new ConcurrentQueue <Packet>();
     chunkDataPackets     = new ConcurrentQueue <Packet>();//java.util.Collections.SynchronizedList(new System.Collections.ArrayList());
     isServerTerminating  = false;
     isTerminating        = false;
     terminationReason    = string.Empty;
     timeSinceLastRead    = 0;
     sendQueueByteLength  = 0;
     chunkDataSendCounter = 0;
     field_20175_w        = 50;
     networkSocket        = socket;
     remoteSocketAddress  = socket.RemoteEndPoint;//GetRemoteSocketAddress();
     netHandler           = nethandler;
     try
     {
         //socket.SetSoTimeout(30000);
         //socket.SetTrafficClass(24);
         socket.ReceiveTimeout = 30000;
         socket.SendTimeout    = 30000;
     }
     catch (System.Net.Sockets.SocketException socketexception)
     {
         System.Console.Error.WriteLine(socketexception.Message);
     }
     socketInputStream  = new java.io.DataInputStream(new NetworkStream(socket, System.IO.FileAccess.Read));   //new java.io.DataInputStream(socket.GetInputStream());
     socketOutputStream = new java.io.DataOutputStream(new NetworkStream(socket, System.IO.FileAccess.Write)); //new java.io.DataOutputStream(new java.io.BufferedOutputStream(socket.GetOutputStream(), 5120));
     readThread         = new Thread(() => { new net.minecraft.src.NetworkReaderThread(this, (new java.lang.StringBuilder()).Append(s).Append(" read thread").ToString()).Run(); });
     writeThread        = new Thread(() => { new net.minecraft.src.NetworkWriterThread(this, (new java.lang.StringBuilder()).Append(s).Append(" write thread").ToString()).Run(); });
     readThread.Start();
     writeThread.Start();
 }
 // Referenced classes of package net.minecraft.src:
 //            Packet, NetHandler, ItemStack
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleWindowClick(this);
 }
Exemple #3
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleVehicleSpawn(this);
 }
Exemple #4
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleArmAnimation(this);
 }
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleNamedEntitySpawn(this);
 }
Exemple #6
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleAttachEntity(this);
 }
Exemple #7
0
 // Referenced classes of package net.minecraft.src:
 //            Packet, NetHandler
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
 }
Exemple #8
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleMovementTypePacket(this);
 }
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleUpdateTime(this);
 }
Exemple #10
0
 public abstract void ProcessPacket(net.minecraft.src.NetHandler nethandler);
Exemple #11
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleBlockChange(this);
 }
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleCraftingGuiClosedPacked(this);
 }
Exemple #13
0
 public virtual void SetNetHandler(net.minecraft.src.NetHandler nethandler)
 {
     netHandler = nethandler;
 }
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleEntityMetadata(this);
 }
Exemple #15
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleKickDisconnect(this);
 }
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandleSetSlot(this);
 }
Exemple #17
0
 public override void ProcessPacket(net.minecraft.src.NetHandler nethandler)
 {
     nethandler.HandlePlayerInventory(this);
 }