Example #1
0
        // Token: 0x06000DD2 RID: 3538 RVA: 0x0011B0CC File Offset: 0x001192CC
        public void textBoxEnter(TextBox sender)
        {
            if (Game1.IsMultiplayer && sender.Text.Length > 0)
            {
                string textToSend = sender.Text.Trim();
                if (textToSend.Length < 1)
                {
                    return;
                }
                if (textToSend[0] == '/' && textToSend.Split(new char[]
                {
                    ' '
                })[0].Length > 1)
                {
                    try
                    {
                        string text = textToSend.Split(new char[]
                        {
                            ' '
                        })[0].Substring(1);
                        uint num = < PrivateImplementationDetails >.ComputeStringHash(text);
                        if (num <= 1013213428u)
                        {
                            if (num != 355814093u)
                            {
                                if (num != 405908334u)
                                {
                                    if (num != 1013213428u)
                                    {
                                        goto IL_211;
                                    }
                                    if (!(text == "texture"))
                                    {
                                        goto IL_211;
                                    }
                                    Game1.player.Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\" + textToSend.Split(new char[]
                                    {
                                        ' '
                                    })[1]);
                                    goto IL_21E;
                                }
                                else if (!(text == "nick"))
                                {
                                    goto IL_211;
                                }
                            }
                            else if (!(text == "nickname"))
                            {
                                goto IL_211;
                            }
                        }
                        else if (num <= 2180167635u)
                        {
                            if (num != 1158129075u)
                            {
                                if (num != 2180167635u)
                                {
                                    goto IL_211;
                                }
                                if (!(text == "rename"))
                                {
                                    goto IL_211;
                                }
                            }
                            else
                            {
                                if (!(text == "othergirl"))
                                {
                                    goto IL_211;
                                }
                                Game1.otherFarmers.Values.ElementAt(0).Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\farmergirl");
                                goto IL_21E;
                            }
                        }
                        else if (num != 2369371622u)
                        {
                            if (num != 2723493283u)
                            {
                                goto IL_211;
                            }
                            if (!(text == "girl"))
                            {
                                goto IL_211;
                            }
                            Game1.player.Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\farmergirl");
                            Game1.player.isMale         = false;
                            goto IL_21E;
                        }
                        else if (!(text == "name"))
                        {
                            goto IL_211;
                        }
                        MultiplayerUtility.sendNameChange(textToSend.Substring(textToSend.IndexOf(' ') + 1), Game1.player.uniqueMultiplayerID);
                        goto IL_21E;
IL_211:
                        this.receiveChatMessage(" Invalid Command ::", 0L);
IL_21E:
                        goto IL_258;
                    }
                    catch (Exception)
                    {
                        this.receiveChatMessage(" Invalid Command Arguments ::", 0L);
                        goto IL_258;
                    }
                }
                MultiplayerUtility.sendChatMessage(textToSend, Game1.player.uniqueMultiplayerID);
                if (Game1.IsServer)
                {
                    this.receiveChatMessage(textToSend, Game1.player.uniqueMultiplayerID);
                }
            }
IL_258:
            sender.Text = "";
            this.clickAway();
        }
Example #2
0
        public void textBoxEnter(TextBox sender)
        {
            if (Game1.IsMultiplayer && sender.Text.Length > 0)
            {
                string message = sender.Text.Trim();
                if (message.Length < 1)
                {
                    return;
                }
                if ((int)message[0] == 47)
                {
                    if (message.Split(' ')[0].Length > 1)
                    {
                        try
                        {
                            string s = message.Split(' ')[0].Substring(1);
                            // ISSUE: reference to a compiler-generated method
                            uint stringHash = \u003CPrivateImplementationDetails\u003E.ComputeStringHash(s);
                            if (stringHash <= 1013213428U)
                            {
                                if ((int)stringHash != 355814093)
                                {
                                    if ((int)stringHash != 405908334)
                                    {
                                        if ((int)stringHash == 1013213428 && s == "texture")
                                        {
                                            Game1.player.Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\" + message.Split(' ')[1]);
                                            goto label_26;
                                        }
                                        else
                                        {
                                            goto label_21;
                                        }
                                    }
                                    else if (!(s == "nick"))
                                    {
                                        goto label_21;
                                    }
                                }
                                else if (!(s == "nickname"))
                                {
                                    goto label_21;
                                }
                            }
                            else if (stringHash <= 2180167635U)
                            {
                                if ((int)stringHash != 1158129075)
                                {
                                    if ((int)stringHash != -2114799661 || !(s == "rename"))
                                    {
                                        goto label_21;
                                    }
                                }
                                else if (s == "othergirl")
                                {
                                    Game1.otherFarmers.Values.ElementAt <Farmer>(0).Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\farmergirl");
                                    goto label_26;
                                }
                                else
                                {
                                    goto label_21;
                                }
                            }
                            else if ((int)stringHash != -1925595674)
                            {
                                if ((int)stringHash == -1571474013 && s == "girl")
                                {
                                    Game1.player.Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\farmergirl");
                                    Game1.player.isMale         = false;
                                    goto label_26;
                                }
                                else
                                {
                                    goto label_21;
                                }
                            }
                            else if (!(s == "name"))
                            {
                                goto label_21;
                            }
                            MultiplayerUtility.sendNameChange(message.Substring(message.IndexOf(' ') + 1), Game1.player.uniqueMultiplayerID);
                            goto label_26;
label_21:
                            this.receiveChatMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:ChatBox.cs.10261"), 0L);
                            goto label_26;
                        }
                        catch (Exception ex)
                        {
                            this.receiveChatMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:ChatBox.cs.10262"), 0L);
                            goto label_26;
                        }
                    }
                }
                MultiplayerUtility.sendChatMessage(message, Game1.player.uniqueMultiplayerID);
                if (Game1.IsServer)
                {
                    this.receiveChatMessage(message, Game1.player.uniqueMultiplayerID);
                }
            }
label_26:
            sender.Text = "";
            this.clickAway();
        }
Example #3
0
        public void textBoxEnter(TextBox sender)
        {
            if (Game1.IsMultiplayer && sender.Text.Length > 0)
            {
                string text = sender.Text.Trim();
                if (text.Length < 1)
                {
                    return;
                }
                if (text[0] == '/' && text.Split(new char[]
                {
                    ' '
                })[0].Length > 1)
                {
                    try
                    {
                        string text2 = text.Split(new char[]
                        {
                            ' '
                        })[0].Substring(1);
                        uint num = < PrivateImplementationDetails >.ComputeStringHash(text2);
                        if (num <= 1013213428u)
                        {
                            if (num != 355814093u)
                            {
                                if (num != 405908334u)
                                {
                                    if (num != 1013213428u)
                                    {
                                        goto IL_214;
                                    }
                                    if (!(text2 == "texture"))
                                    {
                                        goto IL_214;
                                    }
                                    Game1.player.Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\" + text.Split(new char[]
                                    {
                                        ' '
                                    })[1]);
                                    goto IL_231;
                                }
                                else if (!(text2 == "nick"))
                                {
                                    goto IL_214;
                                }
                            }
                            else if (!(text2 == "nickname"))
                            {
                                goto IL_214;
                            }
                        }
                        else if (num <= 2180167635u)
                        {
                            if (num != 1158129075u)
                            {
                                if (num != 2180167635u)
                                {
                                    goto IL_214;
                                }
                                if (!(text2 == "rename"))
                                {
                                    goto IL_214;
                                }
                            }
                            else
                            {
                                if (!(text2 == "othergirl"))
                                {
                                    goto IL_214;
                                }
                                Game1.otherFarmers.Values.ElementAt(0).Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\farmergirl");
                                goto IL_231;
                            }
                        }
                        else if (num != 2369371622u)
                        {
                            if (num != 2723493283u)
                            {
                                goto IL_214;
                            }
                            if (!(text2 == "girl"))
                            {
                                goto IL_214;
                            }
                            Game1.player.Sprite.Texture = Game1.content.Load <Texture2D>("Characters\\farmergirl");
                            Game1.player.isMale         = false;
                            goto IL_231;
                        }
                        else if (!(text2 == "name"))
                        {
                            goto IL_214;
                        }
                        MultiplayerUtility.sendNameChange(text.Substring(text.IndexOf(' ') + 1), Game1.player.uniqueMultiplayerID);
                        goto IL_231;
IL_214:
                        this.receiveChatMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:ChatBox.cs.10261", new object[0]), 0L);
IL_231:
                        goto IL_27B;
                    }
                    catch (Exception)
                    {
                        this.receiveChatMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:ChatBox.cs.10262", new object[0]), 0L);
                        goto IL_27B;
                    }
                }
                MultiplayerUtility.sendChatMessage(text, Game1.player.uniqueMultiplayerID);
                if (Game1.IsServer)
                {
                    this.receiveChatMessage(text, Game1.player.uniqueMultiplayerID);
                }
            }
IL_27B:
            sender.Text = "";
            this.clickAway();
        }