public void UpdatesPlayerSettingsBasedOnItem()
        {
            NetworkPlayerSettings receivedPlayerSettings = new NetworkPlayerSettings() { Name = "Test Name" };
            client.Player.Stub(me => me.PlayerSettings).Return(MockRepository.GenerateStub<IPlayerSettings>());
            client.Player.PlayerSettings.Name = "Nom de Plume";

            networkPlayerController.UpdatePlayerSettingsFromNetworkItem(new Item() { ClientID = 10, Type = ItemType.PlayerSettings, Data = receivedPlayerSettings });

            Assert.AreEqual("Test Name", clientStateTracker.FindNetworkClient(10).Player.PlayerSettings.Name);
        }
        public void UpdatesPlayerSettings()
        {
            stubClientStateTracker.Stub(x => x.FindNetworkClient(3)).Return(client);
            NetworkPlayerSettings receivedPlayerSettings = new NetworkPlayerSettings();
            var item = new Item() { ClientID = 3, Type = ItemType.Player, Data = receivedPlayerSettings };
            playerSettingsMessageHelper.QueuedMessages.Enqueue(item);

            chatLogProcessor.Process(1);

            stubNetworkPlayerProcessor.AssertWasCalled(me => me.UpdatePlayerSettingsFromNetworkItem(Arg<Item>.Is.Equal(item)));
        }
Beispiel #3
0
        public static IPlayerSettings ReadPlayerSettings(this NetBuffer netbuffer)
        {
            IPlayerSettings settings = new NetworkPlayerSettings();

            // TODO: Make IsDirty internal
            var color = new Color() { PackedValue = netbuffer.ReadUInt32() };
            settings.Color = color;
            settings.Name = netbuffer.ReadString();
            settings.Texture = (Frenetic.Graphics.PlayerTexture)netbuffer.ReadUInt16();

            return settings;
        }