Esempio n. 1
0
        public static void OnRead(this NetKcpComponent self, long channelId, MemoryStream memoryStream)
        {
            Session session = self.GetChild <Session>(channelId);

            if (session == null)
            {
                return;
            }

            session.LastRecvTime = TimeHelper.ClientNow();
            self.MessageDispatcher.Dispatch(session, memoryStream);
        }
Esempio n. 2
0
        public static void OnError(this NetKcpComponent self, long channelId, int error)
        {
            Session session = self.GetChild <Session>(channelId);

            if (session == null)
            {
                return;
            }

            session.Error = error;
            session.Dispose();
        }
Esempio n. 3
0
        public static void OnRead(this NetKcpComponent self, long channelId, MemoryStream memoryStream)
        {
            Session session = self.GetChild <Session>(channelId);

            if (session == null)
            {
                return;
            }

            session.LastRecvTime = TimeHelper.ClientNow();

            Game.EventSystem.Callback(self.SessionStreamDispatcherType, session, memoryStream);
        }
Esempio n. 4
0
        public static Session Get(this NetKcpComponent self, long id)
        {
            Session session = self.GetChild <Session>(id);

            return(session);
        }