public static PacketOutStream request_test()
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)99);
            return(packet);
        }
        public static PacketOutStream request_cube()
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.CLIENT.REQUEST_CUBE);
            return(packet);
        }
Exemplo n.º 3
0
        public static PacketOutStream ping(long ticks)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.PONG);
            packet.writeLong(ticks);
            return(packet);
        }
Exemplo n.º 4
0
        public static PacketOutStream normal(string msgTest)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_NORMAL);
            packet.writeString(msgTest);
            return(packet);
        }
Exemplo n.º 5
0
        //SYN SCENE
        public static PacketOutStream response_scene(string sceneName)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_SCENE);
            packet.writeString(sceneName);
            return(packet);
        }
Exemplo n.º 6
0
 public void Send(PacketOutStream packet)
 {
     if (!isConnected)
     {
         return;
     }
     this.session.Write(packet.getPackets());;
     packet.Dispose();
 }
        public static PacketOutStream pong()
        {
            DateTime        dt     = DateTime.UtcNow;
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.CLIENT.PING);
            packet.writeLong(dt.Ticks);
            return(packet);
        }
Exemplo n.º 8
0
 private void FixedUpdate()
 {
     countTime += Time.deltaTime;
     if (countTime >= pongTime)
     {
         countTime = 0.0f;
         PacketOutStream packet = ClientCreatePacket.pong();
         ClientHelper.Instance.Send(packet);
     }
 }
Exemplo n.º 9
0
        public static PacketOutStream response_float(float[] arrs)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_FLOAT);
            packet.writeInt(arrs.Length);
            foreach (float s in arrs)
            {
                packet.writeFloat(s);
            }
            return(packet);
        }
Exemplo n.º 10
0
        public static PacketOutStream response_string(string[] arrs)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_STRING);
            packet.writeInt(arrs.Length);
            foreach (string s in arrs)
            {
                packet.writeString(s);
            }
            return(packet);
        }
Exemplo n.º 11
0
        public static PacketOutStream response_cube(Transform arrs)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.RESPONSE_CUBE);

            packet.writeFloat(arrs.localPosition.x);
            packet.writeFloat(arrs.localPosition.y);
            packet.writeFloat(arrs.localPosition.z);

            packet.writeFloat(arrs.localEulerAngles.x);
            packet.writeFloat(arrs.localEulerAngles.y);
            packet.writeFloat(arrs.localEulerAngles.z);

            packet.writeFloat(arrs.localScale.x);
            packet.writeFloat(arrs.localScale.y);
            packet.writeFloat(arrs.localScale.z);

            return(packet);
        }
Exemplo n.º 12
0
 public void Announce(PacketOutStream packet)
 {
     session.Write(packet.getPackets());
     packet.Dispose();
 }
Exemplo n.º 13
0
 public OutPackageObject(ClientObject client, PacketOutStream packet)
 {
     this.client = client;
     this.packet = packet;
 }
Exemplo n.º 14
0
 public void Broadcast(PacketOutStream packet)
 {
     acceptor.Broadcast(packet.getPackets());;
     packet.Dispose();
 }