void _Recv(CKey Key_, CStream Stream_) { Int32 Proto = 0; Stream_.Pop(ref Proto); switch ((EProto)Proto) { case EProto.AcServerToConnect: { _RecvAcServerToConnect(Key_, Stream_); return; } case EProto.ScAllocated: { _RecvScAllocated(Key_, Stream_); return; } case EProto.ScUserProto: { _RecvFunc(Key_, Stream_); return; } default: { _Net.Close(Key_.PeerNum); return; } } }
void _Close(_TPeersExtIt itPeerExt_) { if (itPeerExt_.Data.NetKey) { var itPeerNet = _PeersNet.Get((Int32)itPeerExt_.Data.NetKey.PeerNum); if (itPeerNet) { itPeerNet.Data.ExtKey = null; if (_Net.IsLinked(itPeerExt_.Data.NetKey.PeerNum)) { _SendUnLink(itPeerExt_.Data.NetKey.PeerNum); } else { _Net.Close(itPeerExt_.Data.NetKey.PeerNum); } } } if (itPeerExt_.Data.itPeerWillExpire) { _PeersWillExpire.Remove(itPeerExt_.Data.itPeerWillExpire); itPeerExt_.Data.itPeerWillExpire = _PeersWillExpire.End(); } _UnLink(itPeerExt_, ENetRet.UserClose); }
void _RecvM(CKey Key_, CStream Stream_) { var Header = new SHeader(); Stream_.Pop(Header); try { switch (Header.Proto) { case EProto.MaPatchData: _RecvMaPatchData(Key_, Stream_); return; default: throw new Exception(); } } catch { _NetM.Close(Key_.PeerNum); } }
void _LoginFailAndCloseS(TPeerCnt PeerNum_, EGameRet GameRet_) { _LoginClear(PeerNum_, GameRet_); _NetS.Close(PeerNum_); _LinkFailFunc(PeerNum_, GameRet_); }