Example #1
0
        // Token: 0x06000B40 RID: 2880 RVA: 0x000E408C File Offset: 0x000E228C
        private static void parseDataMessageFromClient(NetIncomingMessage msg)
        {
            switch (msg.ReadByte())
            {
            case 0:
                Game1.otherFarmers[msg.SenderConnection.RemoteUniqueIdentifier].setMoving(msg.ReadByte());
                return;

            case 1:
            case 2:
            case 12:
            case 15:
            case 16:
            case 18:
                break;

            case 3:
                ((FarmerSprite)Game1.otherFarmers[msg.SenderConnection.RemoteUniqueIdentifier].sprite).CurrentToolIndex = msg.ReadInt32();
                if (msg.ReadByte() == 1)
                {
                    ((FarmerSprite)Game1.otherFarmers[msg.SenderConnection.RemoteUniqueIdentifier].sprite).animateBackwardsOnce(msg.ReadInt32(), msg.ReadFloat());
                    msg.ReadByte();
                    return;
                }
                ((FarmerSprite)Game1.otherFarmers[msg.SenderConnection.RemoteUniqueIdentifier].sprite).animateOnce(msg.ReadInt32(), msg.ReadFloat(), (int)msg.ReadByte());
                return;

            case 4:
                MultiplayerUtility.serverTryToPerformObjectAlteration(msg.ReadInt16(), msg.ReadInt16(), msg.ReadByte(), msg.ReadByte(), msg.ReadInt32(), Game1.otherFarmers[msg.SenderConnection.RemoteUniqueIdentifier]);
                return;

            case 5:
                MultiplayerUtility.warpCharacter(msg.ReadInt16(), msg.ReadInt16(), msg.ReadString(), msg.ReadByte(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 6:
                MultiplayerUtility.performSwitchHeldItem(msg.SenderConnection.RemoteUniqueIdentifier, msg.ReadByte(), (int)msg.ReadInt16());
                return;

            case 7:
                MultiplayerUtility.performToolAction(msg.ReadByte(), msg.ReadByte(), msg.ReadInt16(), msg.ReadInt16(), msg.ReadString(), msg.ReadByte(), msg.ReadInt16(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 8:
                MultiplayerUtility.performDebrisPickup(msg.ReadInt32(), msg.ReadString(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 9:
                MultiplayerUtility.performCheckAction(msg.ReadInt16(), msg.ReadInt16(), msg.ReadString(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 10:
                MultiplayerUtility.receiveChatMessage(msg.ReadString(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 11:
                MultiplayerUtility.receiveNameChange(msg.ReadString(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 13:
                MultiplayerUtility.receiveBuildingChange(msg.ReadByte(), msg.ReadInt16(), msg.ReadInt16(), msg.ReadString(), msg.SenderConnection.RemoteUniqueIdentifier, 0L);
                return;

            case 14:
                MultiplayerUtility.performDebrisCreate(msg.ReadInt16(), msg.ReadInt32(), msg.ReadInt32(), msg.ReadByte(), msg.ReadByte(), msg.ReadInt16(), msg.ReadInt16(), msg.SenderConnection.RemoteUniqueIdentifier);
                return;

            case 17:
                Game1.otherFarmers[msg.SenderConnection.RemoteUniqueIdentifier].readyConfirmation = true;
                MultiplayerUtility.allFarmersReadyCheck();
                return;

            case 19:
                MultiplayerUtility.interpretMessageToEveryone(msg.ReadInt32(), msg.ReadString(), msg.SenderConnection.RemoteUniqueIdentifier);
                break;

            default:
                return;
            }
        }