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

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

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