private bool serverCommands(Account player, Match match) { try { if (!player.HaveGMLevel() || !(text.StartsWith(";") || text.StartsWith(@"\") || text.StartsWith("."))) { return(false); } string str = text.Substring(1); if (str.StartsWith("o") && (int)player.access >= 3) { if (match != null) { AccountManager.getAccountDB((long)2, 2); for (int i = 0; i < match.formação; i++) { SLOT_MATCH slot = match._slots[i]; if (slot._playerId == 0) { slot._playerId = 2; slot.state = SlotMatchState.Normal; } } using (CLAN_WAR_REGIST_MERCENARY_PAK packet = new CLAN_WAR_REGIST_MERCENARY_PAK(match)) match.SendPacketToPlayers(packet); text = "Disputa preenchida. [Servidor]"; } else { text = "Falha ao encher a disputa. [Servidor]"; } } else if (str.StartsWith("gg")) { match._state = MatchState.Play; match._slots[player.matchSlot].state = SlotMatchState.Ready; _client.SendPacket(new CLAN_WAR_ENEMY_INFO_PAK(match)); _client.SendPacket(new CLAN_WAR_CREATED_ROOM_PAK(match)); } else { text = "Falha ao encontrar o comando digitado. [Servidor]"; } return(true); } catch (OverflowException ex) { SaveLog.fatal(ex.ToString()); Printf.b_danger("[CLAN_WAR_TEAM_CHATTING_REC.serverCommands] Erro fatal!"); // Teste return(true); } catch (Exception ex) { SaveLog.fatal(ex.ToString()); Printf.b_danger("[CLAN_WAR_TEAM_CHATTING_REC.serverCommands] Erro fatal!"); return(true); } }
private bool serverCommands(Account player, Match match) { try { if (!player.HaveGMLevel() || !this.text.StartsWith(";") && !this.text.StartsWith("\\") && !this.text.StartsWith(".")) { return(false); } string str = this.text.Substring(1); if (str.StartsWith("o") && player.access >= AccessLevel.Moderator) { if (match != null) { AccountManager.getAccountDB((object)2L, 2); for (int index = 0; index < match.formação; ++index) { SLOT_MATCH slot = match._slots[index]; if (slot._playerId == 0L) { slot._playerId = 2L; slot.state = SlotMatchState.Normal; } } using (CLAN_WAR_REGIST_MERCENARY_PAK registMercenaryPak = new CLAN_WAR_REGIST_MERCENARY_PAK(match)) match.SendPacketToPlayers((SendPacket)registMercenaryPak); this.text = "Disputa preenchida. [Servidor]"; } else { this.text = "Falha ao encher a disputa. [Servidor]"; } } else if (str.StartsWith("gg")) { match._state = MatchState.Play; match._slots[player.matchSlot].state = SlotMatchState.Ready; this._client.SendPacket((SendPacket) new CLAN_WAR_ENEMY_INFO_PAK(match)); this._client.SendPacket((SendPacket) new CLAN_WAR_CREATED_ROOM_PAK(match)); } else { this.text = "Falha ao encontrar o comando digitado. [Servidor]"; } return(true); } catch (OverflowException ex) { return(true); } catch (Exception ex) { Logger.warning(ex.ToString()); return(true); } }
public override void write() { this.writeH((short)1549); this.writeD(this._erro); if (this._erro != 0U) { return; } this.writeH((short)this.m._matchId); this.writeH((ushort)this.m.getServerInfo()); this.writeH((ushort)this.m.getServerInfo()); this.writeC((byte)this.m._state); this.writeC((byte)this.m.friendId); this.writeC((byte)this.m.formação); this.writeC((byte)this.m.getCountPlayers()); this.writeD(this.m._leader); this.writeC((byte)0); this.writeD(this.m.clan._id); this.writeC((byte)this.m.clan._rank); this.writeD(this.m.clan._logo); this.writeS(this.m.clan._name, 17); this.writeT(this.m.clan._pontos); this.writeC((byte)this.m.clan._name_color); for (int index = 0; index < this.m.formação; ++index) { SLOT_MATCH slot = this.m._slots[index]; Account playerBySlot = this.m.getPlayerBySlot(slot); if (playerBySlot != null) { this.writeC((byte)playerBySlot._rank); this.writeS(playerBySlot.player_name, 33); this.writeQ(playerBySlot.player_id); this.writeC((byte)slot.state); } else { this.writeB(new byte[43]); } } }
public override void write() { writeH(1549); writeD(_erro); if (_erro == 0) { writeH((short)m._matchId); writeH((ushort)m.getServerInfo()); writeH((ushort)m.getServerInfo()); writeC((byte)m._state); writeC((byte)m.friendId); writeC((byte)m.formação); writeC((byte)m.getCountPlayers()); writeD(m._leader); writeC(0); writeD(m.clan._id); writeC((byte)m.clan._rank); writeD(m.clan._logo); writeS(m.clan._name, 17); writeT(m.clan._pontos); writeC((byte)m.clan._name_color); for (int i = 0; i < m.formação; i++) { SLOT_MATCH s = m._slots[i]; Account pS = m.getPlayerBySlot(s); if (pS != null) { writeC((byte)pS._rank); writeS(pS.player_name, 33); writeQ(pS.player_id); writeC((byte)s.state); } else { writeB(new byte[43]); } } } }