public override void Handle(GameSession session, PacketReader packet) { MapleopolyMode mode = (MapleopolyMode)packet.ReadByte(); BlueMarble mapleopolyEvent = DatabaseManager.Events.FindMapleopolyEvent(); if (mapleopolyEvent is null) { // TODO: Find an error packet to send if event is not active return; } GameEventUserValue totalTileValue = GameEventHelper.GetUserValue(session.Player, mapleopolyEvent.Id, mapleopolyEvent.EndTimestamp, GameEventUserValueType.MapleopolyTotalTileCount); GameEventUserValue freeRollValue = GameEventHelper.GetUserValue(session.Player, mapleopolyEvent.Id, mapleopolyEvent.EndTimestamp, GameEventUserValueType.MapleopolyFreeRollAmount); GameEventUserValue totalTripValue = GameEventHelper.GetUserValue(session.Player, mapleopolyEvent.Id, mapleopolyEvent.EndTimestamp, GameEventUserValueType.MapleopolyTotalTrips); switch (mode) { case MapleopolyMode.Open: HandleOpen(session, totalTileValue, freeRollValue); break; case MapleopolyMode.Roll: HandleRoll(session, totalTileValue, freeRollValue); break; case MapleopolyMode.ProcessTile: HandleProcessTile(session, totalTileValue, freeRollValue, totalTripValue); break; default: LogUnknownMode(mode); break; } }
public override void Handle(GameSession session, PacketReader packet) { MapleopolyMode mode = (MapleopolyMode)packet.ReadByte(); switch (mode) { case MapleopolyMode.Open: HandleOpen(session); break; case MapleopolyMode.Roll: HandleRoll(session); break; case MapleopolyMode.ProcessTile: HandleProcessTile(session); break; default: IPacketHandler <GameSession> .LogUnknownMode(mode); break; } }