Example #1
0
        public static void OnPlayerJoin(ulong steamId, string alias)
        {
            lobbyPlayerManager pm = null;

            foreach (var _pm in DMTeamManager.DMTM.lobbyPlayerManagers)
            {
                if (_pm.steamID == steamId)
                {
                    pm = _pm;
                    break;
                }
            }

            if (pm == null)
            {
                Console.WriteLine($"OnPlayerJoin: Failed to find ({steamId}) {alias} in lobby players.");
            }

            var p = new Player(pm);

            AddPlayer(p);

            Console.WriteLine($"OnPlayerJoin: ({steamId}) {alias}");

            foreach (var f in _onPlayerJoin)
            {
                try
                {
                    f(p);
                } catch (Exception ex)
                {
                    Console.WriteLine($"OnPlayerJoin Function Error: {f.Method}");
                    Console.WriteLine(ex.Message);
                    Console.WriteLine(ex.Source);
                    Console.WriteLine(ex.StackTrace);
                }
            }
        }
Example #2
0
 public Player(lobbyPlayerManager manager)
 {
     _manager = manager;
 }