コード例 #1
0
        static void Main(string[] args)
        {
            // 创建数据库管理
            DataMgr dataMgr = new DataMgr();
            // 创建玩家管理实例
            PlayerMgr playerMgr = new PlayerMgr();
            //创建房间管理器实例
            RoomMgr roomMgr = new RoomMgr();

            // 创建服务器实例
            GameServer serv = new GameServer();

            // 打开服务器
            serv.Start(7000, 7001);

            while (true)
            {
                string str = Console.ReadLine();
                switch (str)
                {
                case "quit":
                    serv.Close();
                    return;

                case "print":

                    break;
                }
            }
        }
コード例 #2
0
 internal void LeaveGame()
 {
     if (GameServer != null)
     {
         GameServer.Close();
     }
     if (GameClientConnection != null)
     {
         GameClientConnection.Close();
     }
 }
コード例 #3
0
ファイル: Connection.cs プロジェクト: raomuqi/vstgit
 public void Close()
 {
     if (client != null)
     {
         client.Dispose();
     }
     if (server != null)
     {
         server.Close();
     }
     if (multidataConnection != null)
     {
         multidataConnection.Dispose();
     }
     if (syncIpConnection != null)
     {
         syncIpConnection.Dispose();
     }
 }
コード例 #4
0
        public void Show(GameServer server, GameClient client)
        {
            while (true)
            {
                arena = ArenaGenerator.Generate(server.GameAssets, seed, biome_count);
                UpdateItems();

                ConsoleBuffer mapbuf = arena.MapBuffer(tempView);
                buffer = new ConsoleBuffer();
                buffer.InsertBuffer(mapbuf, 0, 0);
                buffer.SetCursorPosition(mapbuf.Width, 0);
                buffer.WriteVertical("".PadRight(25, '▌'));

                buffer.SetCursorPosition(mapbuf.Width, 7);
                buffer.Write("█".PadRight(30, '─'));

                buffer.SetCursorPosition(mapbuf.Width + 1, 1);

                this.ReadMenu();

                if (Selected == proitems.Length - 1)
                {
                    return;
                }
                if (Selected == proitems.Length - 2)
                {
                    GameState gs = new GameState(arena, max_players, port, game_name);
                    server.Open(gs);

                    IPEndPoint ep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port);
                    new ConnectingMenu().Show(client, ep);

                    client.Close();
                    server.Close();
                    return;
                }
            }
        }
コード例 #5
0
ファイル: Server.cs プロジェクト: sybrenw/l2-lattice
 internal static void Shutdown()
 {
     Logger.LogInformation("Stopping network");
     GameServer.Close();
 }
コード例 #6
0
ファイル: MatchController.cs プロジェクト: alansouls/Fdinha
 public void OnDestroy()
 {
     GameServer.Close();
 }
コード例 #7
0
 private void Window_Closed(object sender, EventArgs e)
 {
     GameServer.Close();
 }