예제 #1
0
 // Token: 0x060027D4 RID: 10196 RVA: 0x000F171C File Offset: 0x000EFB1C
 public static void sendChat(EChatMode mode, string text)
 {
     if (!Provider.isServer)
     {
         ChatManager.manager.channel.send("askChat", ESteamCall.SERVER, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
         {
             (byte)mode,
             text
         });
     }
     else if (!Dedicator.isDedicated)
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(Provider.client);
         if (steamPlayer == null)
         {
             return;
         }
         Color color  = (!Provider.isPro) ? Color.white : Palette.PRO;
         bool  isRich = false;
         bool  flag   = true;
         if (ChatManager.onChatted != null)
         {
             ChatManager.onChatted(steamPlayer, mode, ref color, ref isRich, text, ref flag);
         }
         if (ChatManager.process(steamPlayer, text) && flag)
         {
             ChatManager.list(Provider.client, mode, color, isRich, text);
         }
     }
 }
예제 #2
0
 public void askVote(CSteamID steamID, bool vote)
 {
     if (Provider.isServer)
     {
         if (PlayerTool.getSteamPlayer(steamID) == null)
         {
             return;
         }
         if (!ChatManager.isVoting)
         {
             return;
         }
         if (ChatManager.votes.Contains(steamID))
         {
             return;
         }
         ChatManager.votes.Add(steamID);
         if (vote)
         {
             ChatManager.voteYes += 1;
         }
         else
         {
             ChatManager.voteNo += 1;
         }
         ChatManager.manager.channel.send("tellVoteUpdate", ESteamCall.CLIENTS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
         {
             ChatManager.voteYes,
             ChatManager.voteNo
         });
     }
 }
예제 #3
0
 // Token: 0x060027D9 RID: 10201 RVA: 0x000F195C File Offset: 0x000EFD5C
 private void onServerConnected(CSteamID steamID)
 {
     if (Provider.isServer && ChatManager.welcomeText != string.Empty)
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);
         ChatManager.say(steamPlayer.playerID.steamID, string.Format(ChatManager.welcomeText, steamPlayer.playerID.characterName), ChatManager.welcomeColor, false);
     }
 }
예제 #4
0
        // Token: 0x06001DCB RID: 7627 RVA: 0x000A0CA8 File Offset: 0x0009F0A8
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            if (!Provider.hasCheats)
            {
                CommandWindow.LogError(this.localization.format("CheatsErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 3)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = false;
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer))
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
                if (steamPlayer == null)
                {
                    CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                    {
                        componentsFromSerial[0]
                    }));
                    return;
                }
                flag = true;
            }
            ushort num;

            if (!ushort.TryParse(componentsFromSerial[(!flag) ? 1 : 0], out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidAnimalIDErrorText", new object[]
                {
                    componentsFromSerial[(!flag) ? 1 : 0]
                }));
                return;
            }
            if (!AnimalManager.giveAnimal(steamPlayer.player, num))
            {
                CommandWindow.LogError(this.localization.format("NoAnimalIDErrorText", new object[]
                {
                    num
                }));
                return;
            }
            CommandWindow.Log(this.localization.format("AnimalText", new object[]
            {
                steamPlayer.playerID.playerName,
                num
            }));
        }
예제 #5
0
        // Token: 0x06001E1F RID: 7711 RVA: 0x000A42E0 File Offset: 0x000A26E0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            if (!Provider.hasCheats)
            {
                CommandWindow.LogError(this.localization.format("CheatsErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = false;
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer))
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
                if (steamPlayer == null)
                {
                    CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                    {
                        componentsFromSerial[0]
                    }));
                    return;
                }
                flag = true;
            }
            int num;

            if (!int.TryParse(componentsFromSerial[(!flag) ? 1 : 0], out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    componentsFromSerial[(!flag) ? 1 : 0]
                }));
                return;
            }
            steamPlayer.player.skills.askRep(num);
            string text = num.ToString();

            if (num > 0)
            {
                text = '+' + text;
            }
            CommandWindow.Log(this.localization.format("ReputationText", new object[]
            {
                steamPlayer.playerID.playerName,
                text
            }));
        }
예제 #6
0
        public static Player getPlayer(string name)
        {
            SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(name);

            if (steamPlayer != null && steamPlayer.player != null)
            {
                return(steamPlayer.player);
            }
            return(null);
        }
예제 #7
0
        public static Player getPlayer(CSteamID steamID)
        {
            SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);

            if (steamPlayer != null && steamPlayer.player != null)
            {
                return(steamPlayer.player);
            }
            return(null);
        }
예제 #8
0
        public static Transform getPlayerModel(string name)
        {
            SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(name);

            if (steamPlayer != null && steamPlayer.model != null)
            {
                return(steamPlayer.model);
            }
            return(null);
        }
예제 #9
0
        public static Transform getPlayerModel(CSteamID steamID)
        {
            SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);

            if (steamPlayer != null && steamPlayer.model != null)
            {
                return(steamPlayer.model);
            }
            return(null);
        }
예제 #10
0
        public static bool tryGetSteamPlayer(string input, out SteamPlayer player)
        {
            player = null;
            ulong steamID;

            if (ulong.TryParse(input, out steamID))
            {
                player = PlayerTool.getSteamPlayer(steamID);
                return(player != null);
            }
            player = PlayerTool.getSteamPlayer(input);
            return(player != null);
        }
예제 #11
0
        public static bool tryGetSteamID(string input, out CSteamID steamID)
        {
            steamID = CSteamID.Nil;
            ulong num;

            if (ulong.TryParse(input, out num))
            {
                steamID..ctor(num);
                return(true);
            }
            SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(input);

            if (steamPlayer != null)
            {
                steamID = steamPlayer.playerID.steamID;
                return(true);
            }
            return(false);
        }
예제 #12
0
 public void tellVoteStart(CSteamID steamID, CSteamID origin, CSteamID target, byte votesNeeded)
 {
     if (base.channel.checkServer(steamID))
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(origin);
         if (steamPlayer == null)
         {
             return;
         }
         SteamPlayer steamPlayer2 = PlayerTool.getSteamPlayer(target);
         if (steamPlayer2 == null)
         {
             return;
         }
         ChatManager.needsVote = true;
         ChatManager.hasVote   = false;
         if (ChatManager.onVotingStart != null)
         {
             ChatManager.onVotingStart(steamPlayer, steamPlayer2, votesNeeded);
         }
     }
 }
        // Token: 0x06001E2F RID: 7727 RVA: 0x000A4BF8 File Offset: 0x000A2FF8
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = componentsFromSerial.Length == 1;
            SteamPlayer steamPlayer;

            if (flag)
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
            }
            else
            {
                PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer);
            }
            if (steamPlayer == null)
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            if (steamPlayer.player.movement.getVehicle() != null)
            {
                CommandWindow.LogError(this.localization.format("NoVehicleErrorText"));
                return;
            }
            SteamPlayer steamPlayer2;

            if (PlayerTool.tryGetSteamPlayer(componentsFromSerial[(!flag) ? 1 : 0], out steamPlayer2))
            {
                steamPlayer.player.sendTeleport(steamPlayer2.player.transform.position, MeasurementTool.angleToByte(steamPlayer2.player.transform.rotation.eulerAngles.y));
                CommandWindow.Log(this.localization.format("TeleportText", new object[]
                {
                    steamPlayer.playerID.playerName,
                    steamPlayer2.playerID.playerName
                }));
            }
            else if (componentsFromSerial[(!flag) ? 1 : 0].Equals(this.localization.format("WaypointCommand"), StringComparison.InvariantCultureIgnoreCase) && steamPlayer.player.quests.isMarkerPlaced)
            {
                Vector3 markerPosition = steamPlayer.player.quests.markerPosition;
                markerPosition.y = 1024f;
                RaycastHit raycastHit;
                if (Physics.Raycast(markerPosition, Vector3.down, out raycastHit, 2048f, RayMasks.WAYPOINT))
                {
                    steamPlayer.player.sendTeleport(raycastHit.point + Vector3.up, MeasurementTool.angleToByte(steamPlayer.player.transform.rotation.eulerAngles.y));
                    CommandWindow.Log(this.localization.format("TeleportText", new object[]
                    {
                        steamPlayer.playerID.playerName,
                        this.localization.format("WaypointText")
                    }));
                }
            }
            else
            {
                Node node = null;
                for (int i = 0; i < LevelNodes.nodes.Count; i++)
                {
                    if (LevelNodes.nodes[i].type == ENodeType.LOCATION && NameTool.checkNames(componentsFromSerial[(!flag) ? 1 : 0], ((LocationNode)LevelNodes.nodes[i]).name))
                    {
                        node = LevelNodes.nodes[i];
                        break;
                    }
                }
                if (node != null)
                {
                    steamPlayer.player.sendTeleport(node.point, MeasurementTool.angleToByte(steamPlayer.player.transform.rotation.eulerAngles.y));
                    CommandWindow.Log(this.localization.format("TeleportText", new object[]
                    {
                        steamPlayer.playerID.playerName,
                        ((LocationNode)node).name
                    }));
                }
                else
                {
                    CommandWindow.LogError(this.localization.format("NoLocationErrorText", new object[]
                    {
                        componentsFromSerial[(!flag) ? 1 : 0]
                    }));
                }
            }
        }
예제 #14
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            if (!Provider.hasCheats)
            {
                CommandWindow.LogError(this.localization.format("CheatsErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 3)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = false;
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer))
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
                if (steamPlayer == null)
                {
                    CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                    {
                        componentsFromSerial[0]
                    }));
                    return;
                }
                flag = true;
            }
            ushort num;

            if (!ushort.TryParse(componentsFromSerial[(!flag) ? 1 : 0], out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidItemIDErrorText", new object[]
                {
                    componentsFromSerial[(!flag) ? 1 : 0]
                }));
                return;
            }
            byte b = 1;

            if (flag)
            {
                if (componentsFromSerial.Length > 1 && !byte.TryParse(componentsFromSerial[1], out b))
                {
                    CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                    {
                        componentsFromSerial[1]
                    }));
                    return;
                }
            }
            else if (componentsFromSerial.Length > 2 && !byte.TryParse(componentsFromSerial[2], out b))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    componentsFromSerial[2]
                }));
                return;
            }
            if (!ItemTool.tryForceGiveItem(steamPlayer.player, num, b))
            {
                CommandWindow.LogError(this.localization.format("NoItemIDErrorText", new object[]
                {
                    num
                }));
                return;
            }
            CommandWindow.Log(this.localization.format("GiveText", new object[]
            {
                steamPlayer.playerID.playerName,
                num,
                b
            }));
        }
예제 #15
0
        // Token: 0x060027C7 RID: 10183 RVA: 0x000F0C2C File Offset: 0x000EF02C
        public static void list(CSteamID steamID, EChatMode mode, Color color, bool isRich, string text)
        {
            text = text.Trim();
            if (OptionsSettings.filter)
            {
                text = ChatManager.filter(text);
            }
            if (OptionsSettings.streamer)
            {
                color = Color.white;
            }
            SteamPlayer steamPlayer = null;
            string      text2;

            if (steamID == CSteamID.Nil)
            {
                text2 = Provider.localization.format("Say");
            }
            else
            {
                steamPlayer = PlayerTool.getSteamPlayer(steamID);
                if (steamPlayer == null)
                {
                    return;
                }
                if (!OptionsSettings.chatText && steamPlayer.playerID.steamID != Provider.client)
                {
                    return;
                }
                if (steamPlayer.player.quests.isMemberOfSameGroupAs(Player.player))
                {
                    if (steamPlayer.playerID.nickName != string.Empty && steamPlayer.playerID.steamID != Provider.client)
                    {
                        text2 = steamPlayer.playerID.nickName;
                    }
                    else
                    {
                        text2 = steamPlayer.playerID.characterName;
                    }
                }
                else
                {
                    text2 = steamPlayer.playerID.characterName;
                }
            }
            for (int i = ChatManager.chat.Length - 1; i > 0; i--)
            {
                if (ChatManager.chat[i - 1] != null)
                {
                    if (ChatManager.chat[i] == null)
                    {
                        ChatManager.chat[i] = new Chat(ChatManager.chat[i - 1].player, ChatManager.chat[i - 1].mode, ChatManager.chat[i - 1].color, ChatManager.chat[i - 1].isRich, ChatManager.chat[i - 1].speaker, ChatManager.chat[i - 1].text);
                    }
                    else
                    {
                        ChatManager.chat[i].player  = ChatManager.chat[i - 1].player;
                        ChatManager.chat[i].mode    = ChatManager.chat[i - 1].mode;
                        ChatManager.chat[i].color   = ChatManager.chat[i - 1].color;
                        ChatManager.chat[i].isRich  = ChatManager.chat[i - 1].isRich;
                        ChatManager.chat[i].speaker = ChatManager.chat[i - 1].speaker;
                        ChatManager.chat[i].text    = ChatManager.chat[i - 1].text;
                    }
                }
            }
            if (ChatManager.chat[0] == null)
            {
                ChatManager.chat[0] = new Chat(steamPlayer, mode, color, isRich, text2, text);
            }
            else
            {
                ChatManager.chat[0].player  = steamPlayer;
                ChatManager.chat[0].mode    = mode;
                ChatManager.chat[0].color   = color;
                ChatManager.chat[0].isRich  = isRich;
                ChatManager.chat[0].speaker = text2;
                ChatManager.chat[0].text    = text;
            }
            if (ChatManager.onListed != null)
            {
                ChatManager.onListed();
            }
        }
예제 #16
0
 public void askCallVote(CSteamID steamID, CSteamID target)
 {
     if (Provider.isServer)
     {
         if (ChatManager.isVoting)
         {
             return;
         }
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);
         if (steamPlayer == null || Time.realtimeSinceStartup < steamPlayer.nextVote)
         {
             ChatManager.manager.channel.send("tellVoteMessage", steamID, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 1
             });
             return;
         }
         if (!steamPlayer.player.tryToPerformRateLimitedAction())
         {
             return;
         }
         if (!ChatManager.voteAllowed)
         {
             ChatManager.manager.channel.send("tellVoteMessage", steamID, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 0
             });
             return;
         }
         SteamPlayer steamPlayer2 = PlayerTool.getSteamPlayer(target);
         if (steamPlayer2 == null || steamPlayer2.isAdmin)
         {
             return;
         }
         if (Provider.clients.Count < (int)ChatManager.votePlayers)
         {
             ChatManager.manager.channel.send("tellVoteMessage", steamID, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 2
             });
             return;
         }
         CommandWindow.Log(Provider.localization.format("Vote_Kick", new object[]
         {
             steamPlayer.playerID.characterName,
             steamPlayer.playerID.playerName,
             steamPlayer2.playerID.characterName,
             steamPlayer2.playerID.playerName
         }));
         ChatManager.lastVote      = Time.realtimeSinceStartup;
         ChatManager.isVoting      = true;
         ChatManager.voteYes       = 0;
         ChatManager.voteNo        = 0;
         ChatManager.votesPossible = (byte)Provider.clients.Count;
         ChatManager.votesNeeded   = (byte)Mathf.Ceil((float)ChatManager.votesPossible * ChatManager.votePercentage);
         ChatManager.voteOrigin    = steamPlayer;
         ChatManager.voteTarget    = target;
         ChatManager.votes         = new List <CSteamID>();
         P2PSessionState_t p2PSessionState_t;
         if (SteamGameServerNetworking.GetP2PSessionState(ChatManager.voteTarget, out p2PSessionState_t))
         {
             ChatManager.voteIP = p2PSessionState_t.m_nRemoteIP;
         }
         else
         {
             ChatManager.voteIP = 0u;
         }
         ChatManager.manager.channel.send("tellVoteStart", ESteamCall.CLIENTS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
         {
             steamID,
             target,
             ChatManager.votesNeeded
         });
     }
 }
예제 #17
0
 public void askChat(CSteamID steamID, byte mode, string text)
 {
     if (Provider.isServer)
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(steamID);
         if (steamPlayer == null || steamPlayer.player == null)
         {
             return;
         }
         if (Time.realtimeSinceStartup - steamPlayer.lastChat < ChatManager.chatrate)
         {
             return;
         }
         steamPlayer.lastChat = Time.realtimeSinceStartup;
         if (!steamPlayer.player.tryToPerformRateLimitedAction())
         {
             return;
         }
         if (text.Length < 2)
         {
             return;
         }
         if (text.Length > ChatManager.LENGTH)
         {
             text = text.Substring(0, ChatManager.LENGTH);
         }
         text = text.Trim();
         if (mode == 0)
         {
             if (CommandWindow.shouldLogChat)
             {
                 CommandWindow.Log(Provider.localization.format("Global", new object[]
                 {
                     steamPlayer.playerID.characterName,
                     steamPlayer.playerID.playerName,
                     text
                 }));
             }
         }
         else if (mode == 1)
         {
             if (CommandWindow.shouldLogChat)
             {
                 CommandWindow.Log(Provider.localization.format("Local", new object[]
                 {
                     steamPlayer.playerID.characterName,
                     steamPlayer.playerID.playerName,
                     text
                 }));
             }
         }
         else
         {
             if (mode != 2)
             {
                 return;
             }
             if (CommandWindow.shouldLogChat)
             {
                 CommandWindow.Log(Provider.localization.format("Group", new object[]
                 {
                     steamPlayer.playerID.characterName,
                     steamPlayer.playerID.playerName,
                     text
                 }));
             }
         }
         Color color = Color.white;
         if (steamPlayer.isAdmin && !Provider.hideAdmins)
         {
             color = Palette.ADMIN;
         }
         else if (steamPlayer.isPro)
         {
             color = Palette.PRO;
         }
         bool flag  = false;
         bool flag2 = true;
         if (ChatManager.onChatted != null)
         {
             ChatManager.onChatted(steamPlayer, (EChatMode)mode, ref color, ref flag, text, ref flag2);
         }
         if (ChatManager.process(steamPlayer, text) && flag2)
         {
             if (mode == 0)
             {
                 base.channel.send("tellChat", ESteamCall.OTHERS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     steamID,
                     mode,
                     color,
                     flag,
                     text
                 });
             }
             else if (mode == 1)
             {
                 base.channel.send("tellChat", ESteamCall.OTHERS, steamPlayer.player.transform.position, EffectManager.MEDIUM, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     steamID,
                     mode,
                     color,
                     flag,
                     text
                 });
             }
             else if (mode == 2 && steamPlayer.player.quests.groupID != CSteamID.Nil)
             {
                 for (int i = 0; i < Provider.clients.Count; i++)
                 {
                     SteamPlayer steamPlayer2 = Provider.clients[i];
                     if (steamPlayer2.player != null && steamPlayer.player.quests.isMemberOfSameGroupAs(steamPlayer2.player))
                     {
                         base.channel.send("tellChat", steamPlayer2.playerID.steamID, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                         {
                             steamID,
                             mode,
                             color,
                             flag,
                             text
                         });
                     }
                 }
             }
         }
     }
 }
예제 #18
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = componentsFromSerial.Length == 1;
            SteamPlayer steamPlayer;

            if (flag)
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
            }
            else
            {
                PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer);
            }
            if (steamPlayer == null)
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            if (steamPlayer.player.movement.getVehicle() != null)
            {
                CommandWindow.LogError(this.localization.format("NoVehicleErrorText"));
                return;
            }
            SteamPlayer steamPlayer2;

            if (PlayerTool.tryGetSteamPlayer(componentsFromSerial[(!flag) ? 1 : 0], out steamPlayer2))
            {
                steamPlayer.player.sendTeleport(steamPlayer2.player.transform.position, MeasurementTool.angleToByte(steamPlayer2.player.transform.rotation.eulerAngles.y));
                CommandWindow.Log(this.localization.format("TeleportText", new object[]
                {
                    steamPlayer.playerID.playerName,
                    steamPlayer2.playerID.playerName
                }));
            }
            else
            {
                Node node = null;
                for (int i = 0; i < LevelNodes.nodes.Count; i++)
                {
                    if (LevelNodes.nodes[i].type == ENodeType.LOCATION && NameTool.checkNames(componentsFromSerial[(!flag) ? 1 : 0], ((LocationNode)LevelNodes.nodes[i]).name))
                    {
                        node = LevelNodes.nodes[i];
                        break;
                    }
                }
                if (node != null)
                {
                    steamPlayer.player.sendTeleport(node.point, MeasurementTool.angleToByte(steamPlayer.player.transform.rotation.eulerAngles.y));
                    CommandWindow.Log(this.localization.format("TeleportText", new object[]
                    {
                        steamPlayer.playerID.playerName,
                        ((LocationNode)node).name
                    }));
                }
                else
                {
                    CommandWindow.LogError(this.localization.format("NoLocationErrorText", new object[]
                    {
                        componentsFromSerial[(!flag) ? 1 : 0]
                    }));
                }
            }
        }
예제 #19
0
 public static void open()
 {
     if (PlayerDeathUI.active)
     {
         return;
     }
     PlayerDeathUI.active = true;
     PlayerLifeUI.close();
     if (PlayerLife.deathCause == EDeathCause.BLEEDING)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Bleeding");
     }
     else if (PlayerLife.deathCause == EDeathCause.BONES)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Bones");
     }
     else if (PlayerLife.deathCause == EDeathCause.FREEZING)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Freezing");
     }
     else if (PlayerLife.deathCause == EDeathCause.BURNING)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Burning");
     }
     else if (PlayerLife.deathCause == EDeathCause.FOOD)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Food");
     }
     else if (PlayerLife.deathCause == EDeathCause.WATER)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Water");
     }
     else if (PlayerLife.deathCause == EDeathCause.GUN || PlayerLife.deathCause == EDeathCause.MELEE || PlayerLife.deathCause == EDeathCause.PUNCH || PlayerLife.deathCause == EDeathCause.ROADKILL || PlayerLife.deathCause == EDeathCause.GRENADE || PlayerLife.deathCause == EDeathCause.MISSILE || PlayerLife.deathCause == EDeathCause.CHARGE || PlayerLife.deathCause == EDeathCause.SPLASH)
     {
         SteamPlayer steamPlayer = PlayerTool.getSteamPlayer(PlayerLife.deathKiller);
         string      text;
         string      text2;
         if (steamPlayer != null)
         {
             text  = steamPlayer.playerID.characterName;
             text2 = steamPlayer.playerID.playerName;
         }
         else
         {
             text  = "?";
             text2 = "?";
         }
         string text3 = string.Empty;
         if (PlayerLife.deathLimb == ELimb.LEFT_FOOT || PlayerLife.deathLimb == ELimb.LEFT_LEG || PlayerLife.deathLimb == ELimb.RIGHT_FOOT || PlayerLife.deathLimb == ELimb.RIGHT_LEG)
         {
             text3 = PlayerDeathUI.localization.format("Leg");
         }
         else if (PlayerLife.deathLimb == ELimb.LEFT_HAND || PlayerLife.deathLimb == ELimb.LEFT_ARM || PlayerLife.deathLimb == ELimb.RIGHT_HAND || PlayerLife.deathLimb == ELimb.RIGHT_ARM)
         {
             text3 = PlayerDeathUI.localization.format("Arm");
         }
         else if (PlayerLife.deathLimb == ELimb.SPINE)
         {
             text3 = PlayerDeathUI.localization.format("Spine");
         }
         else if (PlayerLife.deathLimb == ELimb.SKULL)
         {
             text3 = PlayerDeathUI.localization.format("Skull");
         }
         if (PlayerLife.deathCause == EDeathCause.GUN)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Gun", new object[]
             {
                 text3,
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.MELEE)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Melee", new object[]
             {
                 text3,
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.PUNCH)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Punch", new object[]
             {
                 text3,
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.ROADKILL)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Roadkill", new object[]
             {
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.GRENADE)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Grenade", new object[]
             {
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.MISSILE)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Missile", new object[]
             {
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.CHARGE)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Charge", new object[]
             {
                 text,
                 text2
             });
         }
         else if (PlayerLife.deathCause == EDeathCause.SPLASH)
         {
             PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Splash", new object[]
             {
                 text,
                 text2
             });
         }
     }
     else if (PlayerLife.deathCause == EDeathCause.ZOMBIE)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Zombie");
     }
     else if (PlayerLife.deathCause == EDeathCause.ANIMAL)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Animal");
     }
     else if (PlayerLife.deathCause == EDeathCause.SUICIDE)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Suicide");
     }
     else if (PlayerLife.deathCause == EDeathCause.KILL)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Kill");
     }
     else if (PlayerLife.deathCause == EDeathCause.INFECTION)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Infection");
     }
     else if (PlayerLife.deathCause == EDeathCause.BREATH)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Breath");
     }
     else if (PlayerLife.deathCause == EDeathCause.ZOMBIE)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Zombie");
     }
     else if (PlayerLife.deathCause == EDeathCause.VEHICLE)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Vehicle");
     }
     else if (PlayerLife.deathCause == EDeathCause.SHRED)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Shred");
     }
     else if (PlayerLife.deathCause == EDeathCause.LANDMINE)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Landmine");
     }
     else if (PlayerLife.deathCause == EDeathCause.ARENA)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Arena");
     }
     else if (PlayerLife.deathCause == EDeathCause.SENTRY)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Sentry");
     }
     else if (PlayerLife.deathCause == EDeathCause.ACID)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Acid");
     }
     else if (PlayerLife.deathCause == EDeathCause.BOULDER)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Boulder");
     }
     else if (PlayerLife.deathCause == EDeathCause.BURNER)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Burner");
     }
     else if (PlayerLife.deathCause == EDeathCause.SPIT)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Spit");
     }
     else if (PlayerLife.deathCause == EDeathCause.SPARK)
     {
         PlayerDeathUI.causeBox.text = PlayerDeathUI.localization.format("Spark");
     }
     if (PlayerLife.deathCause != EDeathCause.SUICIDE && OptionsSettings.music)
     {
         MainCamera.instance.GetComponent <AudioSource>().Play();
     }
     PlayerDeathUI.container.lerpPositionScale(0f, 0f, ESleekLerp.EXPONENTIAL, 20f);
 }