private void InitializeServerEvents() { _server.ClientConnected += (sender, e) => Logger.Trace("Client connected: {0}", e.Client.ToString()); _server.ClientDisconnected += (sender, e) => Logger.Trace("Client disconnected: {0}", e.Client.ToString()); _server.DataReceived += (sender, e) => PacketRouter.Route(e); _server.DataSent += (sender, e) => { }; }
public NetMatchControllerChannels(PacketRouter router) { this.MatchEndedEventChannel = router.Route <MatchEndedEventModel>(); this.MatchStartedEventChannel = router.Route <MatchStartedEventModel>(); this.RoundCreatedEventChannel = router.Route <RoundCreatedEventModel>(); this.RoundEndedEventChannel = router.Route <RoundEndedEventModel>(); this.UserJoinedEventChannel = router.Route <UserJoinedEventModel>(); this.UserLeftEventChannel = router.Route <UserLeftEventModel>(); this.StartMatchRequestChannel = router.Route <StartMatchRequest>(); this.EndMatchRequestChannel = router.Route <EndMatchRequest>(); this.PlayCardRequestChannel = router.Route <PlayCardRequest>(); this.PlayCardResponseChannel = router.Route <PlayCardResponse>(); }
public NetRoomControllerChannels(PacketRouter router) { this.MatchCreatedEventChannel = router.Route <MatchCreatedEventModel>(); this.RoomEndedEventChannel = router.Route <RoomEndedEventModel>(); this.RoomStartedEventChannel = router.Route <RoomStartedEventModel>(); this.UserJoinedEventChannel = router.Route <UserJoinedEventModel>(); this.UserLeftEventChannel = router.Route <UserLeftEventModel>(); this.CloseRoomRequestChannel = router.Route <CloseRoomRequest>(); this.CreateMatchRequestChannel = router.Route <CreateMatchRequest>(); this.GetMatchListRequestChannel = router.Route <GetMatchListRequest>(); this.GetMatchListResponseChannel = router.Route <GetMatchListResponse>(); this.StartRoomRequestChannel = router.Route <StartRoomRequest>(); this.JoinMatchRequestChannel = router.Route <JoinMatchRequest>(); }
private void OnPacket(ClientSocket client, byte[] buffer) => PacketRouter.Route((Client)client.StateObject, buffer);