/** * Player turn, with a dice level they must beat */ public void PlayerTurn(MobileDiceStstatus mds, int diceToBeat) { RemoveGumps(mds); //rolls and sets to previous int currRoll = mds.Roll(); gdg = new GameDiceGump(this, currRoll, diceToBeat); try{ mds.getMobile().SendGump(gdg); }catch { SendMessageAllPlayers("Player " + mds.getMobile().Name + " was disconnected"); RemovePlayer(mds.getMobile(), true); } }
public DiceState(int _goldPerGame, int _gameBalanceMin, int _gameBalanceMax, int _playerToActSeconds, int _maxNumberOfPlayers) { this.goldPerGame = _goldPerGame; this.gameBalanceMin = _gameBalanceMin; this.gameBalanceMax = _gameBalanceMax; this.playerToActSeconds = _playerToActSeconds; this.maxNumberOfPlayers = _maxNumberOfPlayers; gdg = new GameDiceGump(this); sdg = new StatusDiceGump(this); cbg = new CallBluffGump(this); edg = new ExitDiceGump(this); ndgg = new NewDiceGameGump(this, 0); //setup timer to kick player if applicable, really only applies to frozen character when you log off. statusGumpTimer = Timer.DelayCall(TimeSpan.FromSeconds(15), new TimerCallback(StatusTimerCheck)); // Register event disconnect handler EventSink.Disconnected += new DisconnectedEventHandler(EventSink_Disconnected); //register crashed handler. -- Not sure this will actually do anything, unless a save takes place before full crash EventSink.Crashed += new CrashedEventHandler(EventSink_ServerCrashed); }