コード例 #1
0
 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context,
                             ISurrogateSelector selector)
 {
     return(HoloNetPlayer.FindPlayer(info.GetInt32("uniqueId")));
 }
コード例 #2
0
 protected bool Equals(HoloNetPlayer other)
 {
     return(uniqueId == other.uniqueId);
 }
コード例 #3
0
 private void UpdatePlayersCache()
 {
     _serverPlayerCache = Players.FirstOrDefault(item => item.isServer);
     _localPlayerCache  = Players.FirstOrDefault(item => item.isLocal);
 }
コード例 #4
0
 public void OnPlayerDisconnectedFromRoom(HoloNetPlayer disconnectedPlayer)
 {
     HoloNetAppModule.instance.messenger.Publish(NetPlayerDisconnectedMessage.Create(disconnectedPlayer));
     Players.Remove(disconnectedPlayer);
     UpdatePlayersCache();
 }
コード例 #5
0
 public void OnPlayerConnectedToRoom(HoloNetPlayer newPlayer)
 {
     RegisterPlayer(newPlayer);
     HoloNetAppModule.instance.messenger.Publish(NetPlayerConnectedMessage.Create(newPlayer));
     UpdatePlayersCache();
 }
コード例 #6
0
 public void RegisterPlayer(HoloNetPlayer player)
 {
     Players.Add(player);
 }