Esempio n. 1
0
 public ServerChatEngine(UserClientServerLib.UserClientSession userClientSession, IChatEvents chatCreateEvents)
 {
     // TODO: Complete member initialization
     this.userClientSession = userClientSession;
     this.chatCreateEvents  = chatCreateEvents;
     this.userClientSession.SessionChatEvents = this;
 }
        public static IChatEngine CreateChatEngineFromClient(IChatEvents chatCreateEvents, string ip, int port, User currentUser)
        {
            var engine = new ChatEngine(chatCreateEvents, currentUser);

            log4net.LogManager.GetLogger(typeof(ChatEngineFactory)).Error(string.Format("我是:{0}我要连接{1}:{2}", currentUser.UserName, ip, port));
            engine.ChatConn(ip, port);
            return(engine);
        }
Esempio n. 3
0
 public ChatEngine(IChatEvents chatEvents, User currentUser)
 {
     CurrentUser          = currentUser;
     ChatEvents           = chatEvents;
     m_OPTypeLength       = 1;
     m_OPCodeLength       = 1;
     m_ParaCountLength    = 1;
     m_PerParaCountLength = 2;
     ChatCommandBase[] baseArray = new ChatCommandBase[] {
         new DoUserChat(),
     };
     foreach (ChatCommandBase base2 in baseArray)
     {
         this.m_CommandDict.Add(base2.Name, base2);
     }
     this.CommandReader = new ChatReader(this);
 }
 public static IChatEngine CreateChatEngineFromServer(UserClientSession userClientSession, IChatEvents chatCreateEvents)
 {
     return(new ServerChatEngine(userClientSession, chatCreateEvents));
 }