protected virtual void OnProviderUserDisconnected(object sender, ProviderUserEventArgs args) { var user = userMap[args.UserKey]; NetUserDisconnected?.Invoke(this, new NetEventArgs() { User = user, }); userMap.Remove(user.UserKey); userList.Remove(user); }
protected virtual void OnProviderUserConnected(object sender, ProviderUserEventArgs args) { var user = new NetUser(args.UserKey, nextUserId++); userMap[user.UserKey] = user; userList.Add(user); NetUserConnected?.Invoke(this, new NetEventArgs() { User = user, }); }