Exemplo n.º 1
0
        public void RequsetRegister()
        {
            Console.WriteLine("Requst Register to {0}", ServerTag.GetServerTagString());

            MSG_B2CM_Register requset = new MSG_B2CM_Register();

            requset.GroupId = _api.ApiTag.GroupId;
            requset.SubId   = _api.ApiTag.SubId;
            Send(requset);
        }
        private void OnResponse_Regist(MemoryStream stream, int uid)
        {
            MSG_B2CM_Register msg = ProtoBuf.Serializer.Deserialize <MSG_B2CM_Register>(stream);

            _tag.GroupId = (ushort)msg.GroupId;
            _tag.SubId   = (ushort)msg.SubId;
            Key          = _tag.GetServerKey();
            Name         = _tag.Type.ToString();
            if (_manager.AddServer(this))
            {
                Log.Info("{0} regist succese", Tag.GetServerTagString());
            }
        }