Пример #1
0
        public static void Invoke(SNet_Player player, SNet_PlayerEvent playerEvent)
        {
            if (playerEvent == SNet_PlayerEvent.PlayerAgentSpawned)
            {
                if (ExtendedPlayerAgent.TryGetOrCreate(player.PlayerAgent.TryCast <PlayerAgent>(), out ExtendedPlayerAgent p))
                {
                    p.InternalSetup();

                    if (p.IsLocallyOwned)
                    {
                        p.ProgressionReplicator.RequestProgressionData();
                    }
                }
            }
            else if (playerEvent == SNet_PlayerEvent.PlayerAgentDeSpawned)
            {
                if (ExtendedPlayerAgent.TryGet(player.PlayerAgent.TryCast <PlayerAgent>(), out ExtendedPlayerAgent p))
                {
                    ExtendedPlayerAgent.Remove(p.WrappedObj);
                    p.InternalOnDestroyed();
                }
            }
        }
Пример #2
0
 internal static void Post_PlayerLeftHub(SNet_Player player)
 {
     Logger.Verbose("SNet Global: OnPlayerLeftSession");
     SNetMessage.OnPlayerLeftSession?.Invoke(player);
 }
Пример #3
0
 internal static void Post_StateChange(SNet_Player player, pGameState data)
 {
     Logger.Verbose("SNet Global: OnPlayerGameStateChanged");
     SNetMessage.OnPlayerGameStateChanged?.Invoke(player, data.gameState);
 }
 private void OnPlayerJoinedSession(SNet_Player player)
 {
     SyncReplicator();
 }