Inheritance: NetBase
Esempio n. 1
0
        public static seed_info UnPack(ByteArray reader)
        {
            seed_info tbl = new seed_info();

            tbl.client_send_seed    = reader.ReadInt32();
            tbl.client_receive_seed = reader.ReadInt32();

            return(tbl);
        }
Esempio n. 2
0
        // 交换dh密钥请求,将发送客户端公钥到服务器
        public void GetSeedReq()
        {
            int sendSeed = NetCore.Instance.GetSendSeed();
            int recvSeed = NetCore.Instance.GetReceiveSeed();
            Proto.seed_info si = new Proto.seed_info();
            si.client_receive_seed = recvSeed;
            si.client_send_seed = sendSeed;

            NetCore.Instance.Send(Api.ENetMsgId.get_seed_req, si);
        }
Esempio n. 3
0
        // 服务器返回密钥并加密连接
        public object GetSeedAck(byte[] data)
        {
            Proto.ByteArray ba = new Proto.ByteArray(data);
            Proto.seed_info si = Proto.seed_info.UnPack(ba);
            ba.Dispose();

            // 启用加密通讯
            NetCore.Instance.Encrypt(si.client_send_seed, si.client_receive_seed);

            return(null);
        }
Esempio n. 4
0
        // 交换dh密钥请求,将发送客户端公钥到服务器
        public void GetSeedReq()
        {
            int sendSeed = NetCore.Instance.GetSendSeed();
            int recvSeed = NetCore.Instance.GetReceiveSeed();

            Proto.seed_info si = new Proto.seed_info();
            si.client_receive_seed = recvSeed;
            si.client_send_seed    = sendSeed;

            NetCore.Instance.Send(Api.ENetMsgId.get_seed_req, si);
        }
Esempio n. 5
0
        // 交换dh密钥请求,将发送客户端公钥到服务器
        public void KeyExchangeReq()
        {
            int sendSeed = NetCore.Instance.GetSendSeed();
            int recvSeed = NetCore.Instance.GetReceiveSeed();
            Proto.seed_info si = new Proto.seed_info();
            si.NetMsgId = (UInt16)Api.ENetMsgId.get_seed_req;
            si.client_receive_seed = recvSeed;
            si.client_send_seed = sendSeed;

            NetCore.Instance.Send(si);
        }
Esempio n. 6
0
        // 服务器返回公钥
        public object KeyExchangeAck(byte[] data)
        {
            Proto.ByteArray ba = new Proto.ByteArray(data);
            Proto.seed_info si = Proto.seed_info.UnPack(ba);
            ba.Dispose();

            // 启用加密通讯
            NetCore.Instance.Encrypt(si.client_send_seed, si.client_receive_seed);

            // for testing action input
            return(si);
        }
Esempio n. 7
0
        // 交换dh密钥请求,将发送客户端公钥到服务器
        public void KeyExchangeReq()
        {
            int sendSeed = NetCore.Instance.GetSendSeed();
            int recvSeed = NetCore.Instance.GetReceiveSeed();

            Proto.seed_info si = new Proto.seed_info();
            si.NetMsgId            = (Int16)Api.ENetMsgId.get_seed_req;
            si.client_receive_seed = recvSeed;
            si.client_send_seed    = sendSeed;

            NetCore.Instance.Send(si);
        }
Esempio n. 8
0
        public static seed_info UnPack(ByteArray reader)
        {
            seed_info tbl = new seed_info();
            tbl.client_send_seed = reader.ReadInt32();
            tbl.client_receive_seed = reader.ReadInt32();

            return tbl;
        }