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

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

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