Esempio n. 1
0
        public static void func(NcsUser user, NcsRequestInfo requestInfo)
        {
            var    buffer       = requestInfo.Buffer;
            ushort bufferLength = buffer.extract_ushort();
            ushort signal       = buffer.extract_ushort();

            switch (signal)
            {
            case Signal.signal_heartbeat_first:
                user.Send(NcsTemplateBuffer.HeartbeatBuffer2);
                user.heartbeat = true;
                break;

            default:
                Console.WriteLine("unvaild : " + signal);
                break;
            }
        }
Esempio n. 2
0
        public static void func(NcsUser user, NcsRequestInfo requestInfo)
        {
            var    buffer       = requestInfo.Buffer;
            UInt32 bufferLength = buffer.extract_uint();
            ushort signal       = buffer.extract_ushort();

            switch (signal)
            {
            case 1:
                user.Send(NcsTemplateBuffer.HeartbeatBuffer2);
                user.heartbeat = true;
                //Encoding.UTF8.GetString(buffer.extract<byte[]>())
                break;

            default:
                Console.WriteLine("unvaild : " + signal);
                break;
            }
        }