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);
        }
Esempio n. 3
0
        public static PacketOutStream ping(long ticks)
        {
            PacketOutStream packet = new PacketOutStream();

            packet.writeShort((short)PacketOpcode.SERVER.PONG);
            packet.writeLong(ticks);
            return(packet);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio n. 8
0
 private void FixedUpdate()
 {
     countTime += Time.deltaTime;
     if (countTime >= pongTime)
     {
         countTime = 0.0f;
         PacketOutStream packet = ClientCreatePacket.pong();
         ClientHelper.Instance.Send(packet);
     }
 }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio n. 12
0
 public void Announce(PacketOutStream packet)
 {
     session.Write(packet.getPackets());
     packet.Dispose();
 }
Esempio n. 13
0
 public OutPackageObject(ClientObject client, PacketOutStream packet)
 {
     this.client = client;
     this.packet = packet;
 }
Esempio n. 14
0
 public void Broadcast(PacketOutStream packet)
 {
     acceptor.Broadcast(packet.getPackets());;
     packet.Dispose();
 }