Beispiel #1
0
 public GameClient(GameServer svr,byte[] read,byte[] send)
     : base(read,send)
 {
     Lottery = -1;
     tempData = string.Empty;
     m_pingTime = DateTime.Now.Ticks;
     _srvr = svr;
     m_player = null;
     Encryted = true;
     AsyncPostSend = true;
 }
Beispiel #2
0
        public Session(NetConnection connection, GameServer server, string username)
        {
            this.connection = connection;
            this.server = server;
            this.username = username;

            handler.OnUpdatePlayerState += HandleUpdatePlayerStateMessage;
            handler.OnChatTalk += HandleChatTalkMessage;

            player = server.World.AddPlayer();

            SendMessageOrdered(new ChatTalkMessage("Welcome to the servers, press right ctrl to chat !"));
            SendMessageOrdered(new ChatTalkMessage("Type /help to see a list of available commands."));
        }
Beispiel #3
0
        public static void CreateInstance(GameServerConfig config)
        {
            //Only one intance
            if (m_instance != null)
                return;

            // 加载配置文件
            FileInfo logConfig = new FileInfo(config.LogConfigFile);
            if (!logConfig.Exists)
            {
                ResourceUtil.ExtractResource(logConfig.Name, logConfig.FullName,Assembly.GetAssembly(typeof(GameServer)));
            }
            
            //设置日志的配置
            XmlConfigurator.ConfigureAndWatch(logConfig);
   
            m_instance = new GameServer(config);
        }
Beispiel #4
0
 /// <summary>
 /// Constructor for a game client
 /// </summary>
 /// <param name="srvr">The server that's communicating with this client</param>
 public GameClient(GameServer svr,byte[] read,byte[] send)
     : base(read,send)
 {
     _srvr = svr;
     m_player = null;
     Encryted = true;
     AsyncPostSend = true;
 }
Beispiel #5
0
 /// <summary>
 /// </summary>
 /// <param name="server"></param>
 /// <returns></returns>
 private static MasterServerClient CreateMasterServerClient(GameServer server)
 {
     Game = config.getGame();
     return new MasterServerClient(server, config.getGUID());
 }