public override void OnTick(HotSpringRoom room) { try { if(room != null) { room.KickAllPlayer(); //using(PlayerBussiness db = new PlayerBussiness()) //{ // db.DisposeHotSpringRoomInfo(room.Info.ID); //} //GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID); //GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID); //GameServer.Instance.LoginServer.SendHotSpringRoomInfoToPlayer(room.Info.GroomID, false, room.Info); //GameServer.Instance.LoginServer.SendHotSpringRoomInfoToPlayer(room.Info.BrideID, false, room.Info); //HotSpringRoomMgr.RemoveHotSpringRoom(room); GSPacketIn pkg = new GSPacketIn((short)ePackageType.MARRY_ROOM_DISPOSE); pkg.WriteInt(room.Info.ID); WorldMgr.MarryScene.SendToALL(pkg); room.StopTimer(); } } catch(Exception ex) { if (log.IsErrorEnabled) log.Error("OnTick",ex); } }
public GSPacketIn SendHotSpringRoomInfoUpdateToScenePlayers(HotSpringRoom room) { GSPacketIn pkg = new GSPacketIn((short)ePackageType.HOTSPRING_ROOM_ADD_OR_UPDATE); //bool result = room != null; //pkg.WriteBoolean(result); //if (result) //{ // pkg.WriteInt(room.Info.ID); // pkg.WriteBoolean(room.Info.IsHymeneal); // pkg.WriteString(room.Info.Name); // pkg.WriteBoolean(room.Info.Pwd == "" ? false : true); // pkg.WriteInt(room.Info.MapIndex); // pkg.WriteInt(room.Info.AvailTime); // pkg.WriteInt(room.Count); // pkg.WriteInt(room.Info.PlayerID); // pkg.WriteString(room.Info.PlayerName); // pkg.WriteInt(room.Info.GroomID); // pkg.WriteString(room.Info.GroomName); // pkg.WriteInt(room.Info.BrideID); // pkg.WriteString(room.Info.BrideName); // pkg.WriteDateTime(room.Info.BeginTime); // pkg.WriteByte((byte)room.RoomState); // pkg.WriteString(room.Info.RoomIntroduction); //} //SendToScenePlayer(pkg); return(pkg); }
//public static HotSpringRoom[] GetAllHotRoom() //{ // if (ROOM.Count == 0) // { // Caprom(); // } // return ROOM.ToArray(); //} public static HotSpringRoom[] GetAllHotSpringRoom() { HotSpringRoom[] list = null; _locker.AcquireReaderLock(); try { list = new HotSpringRoom[_Rooms.Count]; _Rooms.Values.CopyTo(list, 0); } finally { _locker.ReleaseReaderLock(); } return list == null ? new HotSpringRoom[0] : list; }
public override void OnGameData(HotSpringRoom room, GamePlayer player, GSPacketIn packet) { HotSpringCmdType type = (HotSpringCmdType)packet.ReadByte(); try { IHotSpringCommandHandler handleCommand = _commandMgr.LoadCommandHandler((int)type); if (handleCommand != null) { handleCommand.HandleCommand(this, player, packet); } else { log.Error(string.Format("IP: {0}", player.Client.TcpEndpoint)); } } catch(Exception e) { log.Error(string.Format("IP:{1}, OnGameData is Error: {0}", e.ToString(),player.Client.TcpEndpoint)); } }
public override void OnTick(HotSpringRoom room) { try { if (room != null) { room.KickAllPlayer(); GSPacketIn pkg = new GSPacketIn((short)ePackageType.HOTSPRING_ROOM_REMOVE); pkg.WriteInt(room.Info.RoomID); WorldMgr.HotSpring.SendToALL(pkg); room.StopTimer(); } } catch (Exception exception) { if (log.IsErrorEnabled) { log.Error("OnTick", exception); } } }
public override void OnGameData(HotSpringRoom room, GamePlayer player, GSPacketIn packet) { HotSpringCmdType type = (HotSpringCmdType)packet.ReadByte(); try { IHotSpringCommandHandler handleCommand = _commandMgr.LoadCommandHandler((int)type); if (handleCommand != null) { handleCommand.HandleCommand(this, player, packet); } else { log.Error(string.Format("IP: {0}", player.Client.TcpEndpoint)); } } catch (Exception e) { log.Error(string.Format("IP:{1}, OnGameData is Error: {0}", e.ToString(), player.Client.TcpEndpoint)); } }
//public static HotSpringRoom GetHotRoombyID(int id, string pw, ref string msg) //{ // return ROOM[id - 1]; //} public static HotSpringRoom CreateHotSpringRoomFromDB(HotSpringRoomInfo roomInfo, int timeLeft) { HotSpringRoom room = null; _locker.AcquireWriterLock(); try { room = new HotSpringRoom(roomInfo, _processor); if (room != null) { _Rooms.Add(room.Info.RoomID, room); room.BeginTimer(60 * 1000 * timeLeft); return room; } } finally { _locker.ReleaseWriterLock(); } return null; }
public override void OnTick(HotSpringRoom room) { try { if (room != null) { room.KickAllPlayer(); //using(PlayerBussiness db = new PlayerBussiness()) //{ // db.DisposeHotSpringRoomInfo(room.Info.ID); //} //GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID); //GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID); //GameServer.Instance.LoginServer.SendHotSpringRoomInfoToPlayer(room.Info.GroomID, false, room.Info); //GameServer.Instance.LoginServer.SendHotSpringRoomInfoToPlayer(room.Info.BrideID, false, room.Info); //HotSpringRoomMgr.RemoveHotSpringRoom(room); GSPacketIn pkg = new GSPacketIn((short)ePackageType.MARRY_ROOM_DISPOSE); pkg.WriteInt(room.Info.ID); WorldMgr.MarryScene.SendToALL(pkg); room.StopTimer(); } } catch (Exception ex) { if (log.IsErrorEnabled) { log.Error("OnTick", ex); } } }
public virtual void OnTick(HotSpringRoom room) { }
public virtual void OnGameData(HotSpringRoom game, GamePlayer player, GSPacketIn packet) { }
public GSPacketIn SendHotSpringRoomInfo(GamePlayer player, HotSpringRoom[] allHotRoom) { GSPacketIn packet = new GSPacketIn((byte)ePackageType.HOTSPRING_ROOM_LIST_GET, player.PlayerCharacter.ID); packet.WriteInt(allHotRoom.Length); foreach (HotSpringRoom room in allHotRoom) { packet.WriteInt(room.Info.RoomNumber); packet.WriteInt(room.Info.RoomID); packet.WriteString(room.Info.RoomName); packet.WriteString(room.Info.Pwd); packet.WriteInt(room.Info.AvailTime); packet.WriteInt(room.Count); packet.WriteInt(player.PlayerCharacter.ID); packet.WriteString(player.PlayerCharacter.UserName); packet.WriteDateTime(room.Info.BeginTime); packet.WriteString(room.Info.RoomIntroduction); packet.WriteInt(room.Info.RoomType); packet.WriteInt(room.Info.MaxCount); } SendTCP(packet); return packet; }
public GSPacketIn SendHotSpringRoomInfo(GamePlayer player, HotSpringRoom[] room) { throw new NotImplementedException(); }
public virtual void OnGameData(HotSpringRoom game, Game.Server.GameObjects.GamePlayer player, GSPacketIn packet) { }
public GSPacketIn SendHotSpringRoomInfoUpdateToScenePlayers(HotSpringRoom room) { GSPacketIn pkg = new GSPacketIn((short)ePackageType.HOTSPRING_ROOM_ADD_OR_UPDATE); //bool result = room != null; //pkg.WriteBoolean(result); //if (result) //{ // pkg.WriteInt(room.Info.ID); // pkg.WriteBoolean(room.Info.IsHymeneal); // pkg.WriteString(room.Info.Name); // pkg.WriteBoolean(room.Info.Pwd == "" ? false : true); // pkg.WriteInt(room.Info.MapIndex); // pkg.WriteInt(room.Info.AvailTime); // pkg.WriteInt(room.Count); // pkg.WriteInt(room.Info.PlayerID); // pkg.WriteString(room.Info.PlayerName); // pkg.WriteInt(room.Info.GroomID); // pkg.WriteString(room.Info.GroomName); // pkg.WriteInt(room.Info.BrideID); // pkg.WriteString(room.Info.BrideName); // pkg.WriteDateTime(room.Info.BeginTime); // pkg.WriteByte((byte)room.RoomState); // pkg.WriteString(room.Info.RoomIntroduction); //} //SendToScenePlayer(pkg); return pkg; }
public GSPacketIn SendHotSpringRoomInfoUpdateToScenePlayers(HotSpringRoom room) { return(new GSPacketIn((byte)ePackageType.HOTSPRING_ROOM_ADD_OR_UPDATE)); }