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); }
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(); }
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); }
public static Session Get(this NetKcpComponent self, long id) { Session session = self.GetChild <Session>(id); return(session); }