示例#1
0
 public void close()
 {
     this._prepareToClose = true;
     try
     {
         AccountManager.getInstance().get(this.getPlayer().name).setOnlineStatus(false);
         if (this.getPlayer() != null)
         {
             if (this.getPlayer().getRoom() != null)
             {
                 UdpHandler.getInstance().RemovePlayerInRoom(this.getPlayer());
                 ChannelInfoHolder.getChannel(this.getChannelId()).getRooms()[this.getPlayer().getRoom().getRoomId()].removePlayer(this.getPlayer());
                 this.getPlayer().setRoom((Room)null);
             }
             if (this.getChannelId() >= 0)
             {
                 ChannelInfoHolder.getChannel(this.getChannelId()).removePlayer(this.getPlayer());
             }
         }
         AccountManager.getInstance().get(this.getPlayer().name).setClient((GameClient)null);
         GameClientManager.getInstance().removeClient(this);
         if (this._client.Connected)
         {
             this._client.Close();
             this._stream = (NetworkStream)null;
         }
         CLogger.getInstance().info("Jogador desconectado.");
     }
     catch (Exception ex)
     {
         CLogger.getInstance().warning(ex.ToString());
     }
 }
示例#2
0
 public void close()
 {
     this._prepareToClose = true;
     try
     {
         AccountManager.getInstance().get(this.getPlayer().name)._status = 0;
         this.getPlayer()._status = 0;
         AccountManager.getInstance().get(this.getPlayer().name).setOnlineStatus(false);
         bool flag = this.getPlayer() != null;
         if (flag)
         {
             bool flag2 = this.getPlayer().getRoom() != null;
             if (flag2)
             {
                 UdpHandler.getInstance().RemovePlayerInRoom(this.getPlayer());
                 ChannelInfoHolder.getChannel(this.getChannelId()).getRooms()[this.getPlayer().getRoom().getRoomId()].removePlayer(this.getPlayer());
                 this.getPlayer().setRoom(null);
             }
             bool flag3 = this.getChannelId() >= 0;
             if (flag3)
             {
                 ChannelInfoHolder.getChannel(this.getChannelId()).removePlayer(this.getPlayer());
             }
         }
         AccountManager.getInstance().get(this.getPlayer().name).setClient(null);
         GameClientManager.getInstance().removeClient(this);
         bool connected = this._client.Connected;
         if (connected)
         {
             this._client.Close();
             this._stream = null;
         }
         CLogger.getInstance().info("[GameClient] Player disconnect.");
     }
     catch (Exception ex)
     {
         CLogger.getInstance().warning(ex.ToString());
     }
 }
示例#3
0
 private static void Main(string[] args)
 {
     Console.Title = "Project Blackout Server";
     CLogger.getInstance().form();
     Console.ForegroundColor = ConsoleColor.Green;
     CLogger.getInstance().info("-----------------------------");
     CLogger.getInstance().info("|   Servidor Project Wars   |");
     CLogger.getInstance().info("|         PVP 4X4           |");
     CLogger.getInstance().info("|         FIX 88%           |");
     CLogger.getInstance().info("|  developer by Skelleton   |");
     CLogger.getInstance().info("|      SystemPBlackout      |");
     CLogger.getInstance().info("|     Version: " + ((object)ServerVersion.version).ToString() + "     |");
     CLogger.getInstance().info("|       New Battle          |");
     CLogger.getInstance().info("|   Creation By Skelleton   |");
     CLogger.getInstance().info("-----------------------------");
     Console.ForegroundColor = ConsoleColor.White;
     Config.load();
     StartedInventoryItemsParser.getInstance();
     UdpHandler.getInstance().SendPacket((short)byte.MaxValue, new byte[4]);
     GameServerInfoParser.getInstance();
     ChannelInfoParser.getInstance();
     ClanManager.getInstance();
     AccountManager.getInstance();
     ConfigManager.getInstance();
     FriendManager.getInstance();
     RankExpInfoParser.getInstance();
     ShopInfoManager.getInstance();
     MissionManager.getInstance();
     PlayerTemplateParser.getInstance();
     LoginClientManager.getInstance();
     GameClientManager.getInstance();
     NetworkLoginFactory.getInstance();
     NetworkGameFactory.getInstance();
     CLogger.getInstance().warning("Servidor aberto");
     CLogger.getInstance().warning("Servidor aberto");
     CLogger.getInstance().warning("Servidor aberto");
     CLogger.getInstance().warning("Servidor aberto");
     Process.GetCurrentProcess().WaitForExit();
 }
示例#4
0
 private static void accept(TcpClient client)
 {
     GameClientManager.getInstance().addClient(client);
 }