Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 3
0
 public Animation(ClientWrapper client, MSGBuffer buffer) : base(client, buffer)
 {
     SendId = 0x0B;
     ReadId = 0x0A;
 }
Ejemplo n.º 4
0
 public ClickWindow(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     ReadId = 0x0F;
 }
Ejemplo n.º 5
0
 public SpawnPlayer(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x0C;
 }
Ejemplo n.º 6
0
 private void connectionSend(ClientWrapper wrapper, int time)
 {
     ClientWrapper.TrySend(wrapper);
 }
Ejemplo n.º 7
0
 public void Write(ClientWrapper state, MSGBuffer buffer, object[] Arguments)
 {
     buffer.WriteVarInt(PacketID);
     buffer.Write((byte[])Arguments[0]);
     buffer.FlushData();
 }
Ejemplo n.º 8
0
 public PlayerBlockPlacement(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     ReadId = 0x09;
 }
Ejemplo n.º 9
0
 public EntityTeleport(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x18;
 }
Ejemplo n.º 10
0
 public JoinGame(ClientWrapper client) : base(client)
 {
     SendId = 0x01;
 }
Ejemplo n.º 11
0
 public PlayerListHeaderFooter(ClientWrapper client, MSGBuffer buffer) : base(client, buffer)
 {
     SendId = 0x47;
 }
Ejemplo n.º 12
0
 public PlayerListHeaderFooter(ClientWrapper client) : base(client)
 {
     SendId = 0x47;
 }
Ejemplo n.º 13
0
 public UpdateSign(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x33;
     ReadId = 0x12;             //0x13
 }
Ejemplo n.º 14
0
 public UpdateSign(ClientWrapper client) : base(client)
 {
     SendId = 0x33;
     ReadId = 0x12;             //0x13
 }
Ejemplo n.º 15
0
 public EntityHeadLook(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x19;
 }
Ejemplo n.º 16
0
 public EntityHeadLook(ClientWrapper client) : base(client)
 {
     SendId = 0x19;
 }
Ejemplo n.º 17
0
 public EntityTeleport(ClientWrapper client) : base(client)
 {
     SendId = 0x18;
 }
Ejemplo n.º 18
0
 public JoinGame(ClientWrapper client, MSGBuffer buffer) : base(client, buffer)
 {
     SendId = 0x01;
 }
Ejemplo n.º 19
0
 public PlayerBlockPlacement(ClientWrapper client) : base(client)
 {
     ReadId = 0x09;
 }
Ejemplo n.º 20
0
 public MapChunkBulk(ClientWrapper client) : base(client)
 {
     SendId = 0x26;
 }
Ejemplo n.º 21
0
 public void Read(ClientWrapper state, MSGBuffer buffer, object[] Arguments)
 {
 }
Ejemplo n.º 22
0
 public MapChunkBulk(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x26;
 }
Ejemplo n.º 23
0
 private void connectionReceive(ClientWrapper wrapper, int time)
 {
     ClientWrapper.TryReceive(wrapper);
 }
 internal static Client ToDomain(this ClientWrapper value)
 {
     return(s_clientMapper.ApiToDomain(value));
 }
Ejemplo n.º 25
0
 public SpawnPlayer(ClientWrapper client) : base(client)
 {
     SendId = 0x0C;
 }
Ejemplo n.º 26
0
 public SpawnObject(ClientWrapper client) : base(client)
 {
     SendId = 0x0E;
 }
Ejemplo n.º 27
0
 public ClickWindow(ClientWrapper client) : base(client)
 {
     ReadId = 0x0F;
 }
Ejemplo n.º 28
0
 public SpawnObject(ClientWrapper client, DataBuffer buffer) : base(client, buffer)
 {
     SendId = 0x0E;
 }
Ejemplo n.º 29
0
 public Animation(ClientWrapper client) : base(client)
 {
     SendId = 0x0B;
     ReadId = 0x0A;
 }
Ejemplo n.º 30
0
 public UseEntity(ClientWrapper client)
     : base(client)
 {
     ReadId = 0x02;
 }
Ejemplo n.º 31
0
 public LoginStart(ClientWrapper client) : base(client)
 {
     ReadId = 0x00;
 }
Ejemplo n.º 32
0
 public UseEntity(ClientWrapper client, MSGBuffer buffer)
     : base(client, buffer)
 {
     ReadId = 0x02;
 }