Example #1
0
        public Matcher(BstCallbacks bstCallbacks) : base(bstCallbacks)
        {
            // 注册广播
            // BroadcastCallback matchTimeoutBst = new BroadcastCallback(this.matchUsersTimeoutBroadcast);
            // BroadcastCallback matchUserstBst = new BroadcastCallback(this.matchUsersBroadcast);

            this.SetBroadcastHandler(MatchTimeoutBroadcastType, this.MatchUsersTimeoutBroadcast);
            this.SetBroadcastHandler(MatchUsersBroadcastType, this.MatchUsersBroadcast);
            this.SetBroadcastHandler(CancelMatchBroadcastType, this.CancelMatchBroadcast);
        }
Example #2
0
 public Group(BstCallbacks bstCallbacks) : base(bstCallbacks)
 {
     // 注册广播
     this.SetBroadcastHandler(this._joinGroupBstType, this.OnJoinGroup);
     this.SetBroadcastHandler(this._leaveGroupBstType, this.OnLeaveGroup);
     this.SetBroadcastHandler(this._dismissGroupBstType, this.OnDismissGroup);
     this.SetBroadcastHandler(this._changeGroupBstType, this.OnChangeGroup);
     this.SetBroadcastHandler(this._removeGroupBstType, this.OnRemoveGroupPlayer);
     this.SetBroadcastHandler(this._changeCustomGroupPlayerStatusBstType, this.OnChangeCustomGroupPlayerStatus);
     this.SetBroadcastHandler(this._recvFromGroupClientType, this.OnRecvFromGroupClient);
 }
Example #3
0
 public Room(BstCallbacks bstCallbacks) : base(bstCallbacks)
 {
     // 注册广播
     this.SetBroadcastHandler(this._joinRoomBroadcastType, this.OnJoinRoom);
     this.SetBroadcastHandler(this._leaveRoomBroadcastType, this.OnLeaveRoom);
     this.SetBroadcastHandler(this._dismissRoomBroadcastType, this.OnDismissRoom);
     this.SetBroadcastHandler(this._changeRoomBroadcastType, this.OnChangeRoom);
     this.SetBroadcastHandler(this._removeUserBroadcastType, this.OnRemoveUser);
     this.SetBroadcastHandler(this._changeUserStateBroadcastType, this.OnChangeUserState);
     this.SetBroadcastHandler(this._roomUserNetworkBroadcastType, this.OnChangePlayerNetworkState);
     this.SetBroadcastHandler(this._testBroadcastType, TestBroadcast);
 }
Example #4
0
        public FrameSender(BstCallbacks bstCallbacks)
        {
            this._bstCallbacks = bstCallbacks;
            this.NetUtil1      = new BaseNetUtil(bstCallbacks);
            this.NetUtil2      = new BaseNetUtil(bstCallbacks);

            // socket1 注册广播
            this.NetUtil1.SetBroadcastHandler(_startGameBroadcastType, this.OnStartFrameSync);
            this.NetUtil1.SetBroadcastHandler(_stopGameBroadcastType, this.OnStopFrameSync);

            // socket2 注册广播
            this.NetUtil2.SetBroadcastHandler(_frameBroadcastType, this.OnRecvFrame);
            this.NetUtil2.SetBroadcastHandler(_sendMessageExtBroadcastType, this.OnRecvFromGameSvr);
        }
Example #5
0
 public User(BstCallbacks bstCallbacks) : base(bstCallbacks)
 {
 }
Example #6
0
 public Pinger(BstCallbacks bstCallbacks, int id, FrameSender frameSender) : base(bstCallbacks)
 {
     this.Id          = id;
     this.FrameSender = frameSender;
 }
Example #7
0
 public NetClient(BstCallbacks bstCallbacks)
 {
     this._bstCallbacks = bstCallbacks;
 }
Example #8
0
        public Sender(BstCallbacks bstCallbacks) : base(bstCallbacks)
        {
            var bst = new BroadcastCallback(OnRecvFromClient);

            SetBroadcastHandler(_messageBroadcastType, bst);
        }
Example #9
0
 public BaseNetUtil(BstCallbacks bstCallbacks)
 {
     this.bstCallbacks = bstCallbacks;
     client            = new NetClient(bstCallbacks);
     _server           = new NetServer();
 }