Example #1
0
        void Send(object clientName, ClientWrapper wrapper)
        {
            if (wrapper.Connected)
            {
                string private_ip = "10.10.11.13";
                int private_port = 1071;

                string public_ip = "92.160.12.2";
                int public_port = 1072;

                NetworkNodeRegistrationRequest req = new NetworkNodeRegistrationRequest();
                //req.NodeMetadata = new NodeMetadata() { Name = clientName.ToString(), PrivateEndpoint = new IPEndPoint(IPAddress.Parse(private_ip), private_port), PublicEndpoint = new IPEndPoint(IPAddress.Parse(public_ip), public_port) };

                NetworkNodeRegistrationResponse res = wrapper.SendRequest(req) as NetworkNodeRegistrationResponse;
            }
        }
Example #2
0
        void StartCommunication(object clientName)
        {
            string client = clientName.ToString();
            bool result = false;
            //IPEndPoint endpoint = new IPEndPoint(IPAddress.Parse("192.168.0.103"), 9999);
            IPEndPoint endpoint = new IPEndPoint(IPAddress.Loopback, 9999);
            ClientWrapper wrapper = new ClientWrapper(endpoint);
            result = wrapper.Connect();

            if (result)
            {
                for (int i = 0; i < 100; i++)
                {
                    Send(client, wrapper);
                    Thread.Sleep(new Random().Next(1000, 5000));
                }
            }
        }
Example #3
0
 public Animation(ClientWrapper client, MSGBuffer buffer) : base(client, buffer)
 {
     SendId = 0x0B;
     ReadId = 0x0A;
 }
Example #4
0
 public ClickWindow(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     ReadId = 0x0F;
 }
Example #5
0
 public SpawnPlayer(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x0C;
 }
Example #6
0
 private void connectionSend(ClientWrapper wrapper, int time)
 {
     ClientWrapper.TrySend(wrapper);
 }
Example #7
0
 public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments)
 {
     buffer.WriteVarInt(PacketID);
     buffer.Write((byte[])Arguments[0]);
     buffer.FlushData();
 }
 public PlayerBlockPlacement(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     ReadId = 0x09;
 }
Example #9
0
 public EntityTeleport(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x18;
 }
Example #10
0
 public JoinGame(ClientWrapper client) : base(client)
 {
     SendId = 0x01;
 }
Example #11
0
 public PlayerListHeaderFooter(ClientWrapper client, MSGBuffer buffer) : base(client, buffer)
 {
     SendId = 0x47;
 }
Example #12
0
 public PlayerListHeaderFooter(ClientWrapper client) : base(client)
 {
     SendId = 0x47;
 }
Example #13
0
 public UpdateSign(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x33;
     ReadId = 0x12;             //0x13
 }
Example #14
0
 public UpdateSign(ClientWrapper client) : base(client)
 {
     SendId = 0x33;
     ReadId = 0x12;             //0x13
 }
Example #15
0
 public EntityHeadLook(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x19;
 }
Example #16
0
 public EntityHeadLook(ClientWrapper client) : base(client)
 {
     SendId = 0x19;
 }
Example #17
0
 public EntityTeleport(ClientWrapper client) : base(client)
 {
     SendId = 0x18;
 }
Example #18
0
 public JoinGame(ClientWrapper client, MSGBuffer buffer) : base(client, buffer)
 {
     SendId = 0x01;
 }
 public PlayerBlockPlacement(ClientWrapper client) : base(client)
 {
     ReadId = 0x09;
 }
Example #20
0
 public MapChunkBulk(ClientWrapper client) : base(client)
 {
     SendId = 0x26;
 }
Example #21
0
 public void Read(ClientWrapper state, MSGBuffer buffer, object[] Arguments)
 {
 }
Example #22
0
 public MapChunkBulk(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x26;
 }
Example #23
0
 private void connectionReceive(ClientWrapper wrapper, int time)
 {
     ClientWrapper.TryReceive(wrapper);
 }
 internal static Client ToDomain(this ClientWrapper value)
 {
     return(s_clientMapper.ApiToDomain(value));
 }
Example #25
0
 public SpawnPlayer(ClientWrapper client) : base(client)
 {
     SendId = 0x0C;
 }
Example #26
0
 public SpawnObject(ClientWrapper client) : base(client)
 {
     SendId = 0x0E;
 }
Example #27
0
 public ClickWindow(ClientWrapper client) : base(client)
 {
     ReadId = 0x0F;
 }
Example #28
0
 public SpawnObject(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x0E;
 }
Example #29
0
 public Animation(ClientWrapper client) : base(client)
 {
     SendId = 0x0B;
     ReadId = 0x0A;
 }
Example #30
0
 public UseEntity(ClientWrapper client)
     : base(client)
 {
     ReadId = 0x02;
 }
Example #31
0
 public LoginStart(ClientWrapper client) : base(client)
 {
     ReadId = 0x00;
 }
Example #32
0
 public UseEntity(ClientWrapper client, MSGBuffer buffer)
     : base(client, buffer)
 {
     ReadId = 0x02;
 }