public override void OnTick(SpaRoom room) { try { if (room != null) { room.KickAllPlayer(); using (PlayerBussiness db = new PlayerBussiness()) { db.DisposeSpaRoomInfo(room.Spa_Room_Info.RoomID); } SpaRoomMgr.RemoveSpaRoom(room); GSPacketIn pkg = new GSPacketIn(174); pkg.WriteInt(room.Spa_Room_Info.RoomID); WorldMgr.SpaScene.SendToALL(pkg); room.StopTimer(); } } catch (Exception ex) { //if (SpaLogicProcessor.log.IsErrorEnabled) { SpaLogicProcessor.log.Error("OnTick", ex); } } }
public GSPacketIn SendSpaRoomInfoUpdateToSpaScenePlayers(SpaRoom room) { GSPacketIn pkg = new GSPacketIn(173); pkg.WriteInt(room.Spa_Room_Info.RoomNumber); pkg.WriteInt(room.Spa_Room_Info.RoomID); pkg.WriteString(room.Spa_Room_Info.RoomName); pkg.WriteString(room.Spa_Room_Info.Pwd); pkg.WriteInt(room.RoomLeftMin); pkg.WriteInt(room.Count); pkg.WriteInt(room.Spa_Room_Info.PlayerID); pkg.WriteString(room.Spa_Room_Info.PlayerName); pkg.WriteDateTime(room.Spa_Room_Info.BeginTime); pkg.WriteString(room.Spa_Room_Info.RoomIntroduction); pkg.WriteInt(room.Spa_Room_Info.RoomType); pkg.WriteInt(room.Spa_Room_Info.MaxCount); this.SendToScenePlayer(pkg); return(pkg); }
public override void OnGameData(SpaRoom room, GamePlayer player, GSPacketIn packet) { SpaCmdType type = (SpaCmdType)packet.ReadByte(); try { ISpaCommandHandler handleCommand = this._commandMgr.LoadCommandHandler((int)type); if (handleCommand != null) { handleCommand.HandleCommand(player, packet); } else { SpaLogicProcessor.log.Error(string.Format("IP: {0}", player.Client.TcpEndpoint)); } } catch (Exception e) { SpaLogicProcessor.log.Error(string.Format("IP:{1}, OnGameData is Error: {0}", e.ToString(), player.Client.TcpEndpoint)); } }
public virtual void OnGameData(SpaRoom game, GamePlayer player, GSPacketIn packet) { }
public virtual void OnTick(SpaRoom room) { }