示例#1
0
        internal static void OnGameServerConnect(GameServer game, int index, string name, string image, string ip, short port, string key)
        {
            if (!key.Equals(Settings.AcceptorKey))
            {
                ConsoleUtils.Write(
                    ConsoleMsgType.Warning,
                    "Invalid Server Acceptor Key received from {0}:{1}. '{2}' received ; '{3}' expected.",
                    ip, port, key, Settings.AcceptorKey
                    );
                ServerPacketHandler.send_ServerConnectionResult(game, false);
            }

            game.Ip        = System.Net.IPAddress.Parse(ip);
            game.Port      = port;
            game.Index     = (byte)index;
            game.Name      = name;
            game.NoticeUrl = image;

            Server.Instance.AddGameServer(game);
            ServerPacketHandler.send_ServerConnectionResult(game, true);
        }
示例#2
0
 public NetworkManager()
 {
     ServerPacketHandler.Start();
     ClientPacketHandler.Start();
 }
示例#3
0
 private void UserJoinGame(Client client, byte server_index)
 {
     byte[] key = { 0x00, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 };             // TODO : Generate a key
     ServerPacketHandler.send_ClientJoin(ServerList[server_index], client, key);
     ClientPacketHandler.send_JoinGame(client, key);
 }
示例#4
0
 private void OnCommandReceived(PacketStream stream)
 {
     ServerPacketHandler.PacketReceived(this, stream);
 }