Exemplo n.º 1
0
        public static void createskull(Arg arg)
        {
            string     text       = arg.GetString(0);
            BasePlayer basePlayer = ArgEx.Player(arg);

            if (string.IsNullOrEmpty(text))
            {
                text = RandomUsernames.Get(Random.Range(0, 1000));
            }
            Item item = ItemManager.Create(ItemManager.FindItemDefinition("skull.human"), 1, 0uL);

            item.name = HumanBodyResourceDispenser.CreateSkullName(text);
            basePlayer.inventory.GiveItem(item);
        }
Exemplo n.º 2
0
    public static IEnumerator Run(Connection connection)
    {
        connection.authStatus = "";
        if (!PlatformService.Instance.BeginPlayerSession(connection.userid, connection.token))
        {
            ConnectionAuth.Reject(connection, "Steam Auth Failed");
            yield break;
        }
        waitingList.Add(connection);
        Stopwatch timeout = Stopwatch.StartNew();

        while (timeout.Elapsed.TotalSeconds < 30.0 && connection.active && !(connection.authStatus != ""))
        {
            yield return(null);
        }
        waitingList.Remove(connection);
        if (connection.active)
        {
            if (connection.authStatus.Length == 0)
            {
                ConnectionAuth.Reject(connection, "Steam Auth Timeout");
                PlatformService.Instance.EndPlayerSession(connection.userid);
            }
            else if (connection.authStatus == "banned")
            {
                ConnectionAuth.Reject(connection, "Auth: " + connection.authStatus);
                PlatformService.Instance.EndPlayerSession(connection.userid);
            }
            else if (connection.authStatus == "gamebanned")
            {
                ConnectionAuth.Reject(connection, "Steam Auth: " + connection.authStatus);
                PlatformService.Instance.EndPlayerSession(connection.userid);
            }
            else if (connection.authStatus == "vacbanned")
            {
                ConnectionAuth.Reject(connection, "Steam Auth: " + connection.authStatus);
                PlatformService.Instance.EndPlayerSession(connection.userid);
            }
            else if (connection.authStatus != "ok")
            {
                ConnectionAuth.Reject(connection, "Steam Auth Failed", "Steam Auth Error: " + connection.authStatus);
                PlatformService.Instance.EndPlayerSession(connection.userid);
            }
            else
            {
                string userName = (ConVar.Server.censorplayerlist ? RandomUsernames.Get(connection.userid + (ulong)Random.Range(0, 100000)) : connection.username);
                PlatformService.Instance.UpdatePlayerSession(connection.userid, userName);
            }
        }
    }
Exemplo n.º 3
0
 private void Awake()
 {
     npc             = GetComponent <NPCPlayer>();
     npc.displayName = RandomUsernames.Get(Random.Range(0, RandomUsernames.All.Length - 1));
     enabled         = false;
 }