Ejemplo n.º 1
0
 public void SyncThingsToJoiningPlayer(int playerIndex)
 {
     foreach (KeyValuePair <ushort, ICreativePower> item in _powersById)
     {
         NetPacket packet = NetCreativePowerPermissionsModule.SerializeCurrentPowerPermissionLevel(item.Key, (int)item.Value.CurrentPermissionLevel);
         NetManager.Instance.SendToClient(packet, playerIndex);
     }
     foreach (KeyValuePair <ushort, ICreativePower> item2 in _powersById)
     {
         (item2.Value as IOnPlayerJoining)?.OnPlayerJoining(playerIndex);
     }
 }
Ejemplo n.º 2
0
 public void SyncThingsToJoiningPlayer(int playerIndex)
 {
     foreach (KeyValuePair <ushort, ICreativePower> keyValuePair in this._powersById)
     {
         NetPacket packet = NetCreativePowerPermissionsModule.SerializeCurrentPowerPermissionLevel(keyValuePair.Key, (int)keyValuePair.Value.CurrentPermissionLevel);
         NetManager.Instance.SendToClient(packet, playerIndex);
     }
     foreach (KeyValuePair <ushort, ICreativePower> keyValuePair in this._powersById)
     {
         if (keyValuePair.Value is IOnPlayerJoining onPlayerJoining)
         {
             onPlayerJoining.OnPlayerJoining(playerIndex);
         }
     }
 }