public GameStateSender(Log<ChatMessage> chatLog, IClientStateTracker clientStateTracker, ISnapCounter snapCounter, IOutgoingMessageQueue outgoingMessageQueue) { this.ChatLog = chatLog; this.ClientStateTracker = clientStateTracker; this.SnapCounter = snapCounter; this.OutgoingMessageQueue = outgoingMessageQueue; }
public ClientInputProcessor(INetworkPlayerProcessor networkPlayerProcessor, Log<ChatMessage> serverChatLog, IClientStateTracker clientStateTracker, IIncomingMessageQueue incomingMessageQueue) { this.NetworkPlayerProcessor = networkPlayerProcessor; this.ServerChatLog = serverChatLog; this.ClientStateTracker = clientStateTracker; this.IncomingMessageQueue = incomingMessageQueue; }
public GameStateProcessor(LocalClient localClient, Log<ChatMessage> chatLog, INetworkPlayerProcessor networkPlayerProcessor, IClientStateTracker clientStateTracker, IIncomingMessageQueue incomingMessageQueue) { this.LocalClient = localClient; this.ChatLog = chatLog; this.ClientStateTracker = clientStateTracker; this.IncomingMessageQueue = incomingMessageQueue; this.NetworkPlayerProcessor = networkPlayerProcessor; }
public void SetUp() { client = new Client(MockRepository.GenerateStub<IPlayer>()) { ID = 10 }; localClient = new Client(MockRepository.GenerateStub<IPlayer>()) { ID = 99 }; clientStateTracker = MockRepository.GenerateStub<IClientStateTracker>(); clientStateTracker.Stub(me => me.FindNetworkClient(10)).Return(client); clientStateTracker.Stub(me => me.LocalClient).Return(localClient); clientStateTracker.Stub(me => me.NetworkClients).Return(new List<Client>() { client }); networkPlayerController = new NetworkPlayerProcessor(clientStateTracker); }
public void SetUp() { stubClientStateTracker = MockRepository.GenerateStub<IClientStateTracker>(); List<Client> clientList = new List<Client>(); stubClientStateTracker.Stub(x => x.NetworkClients).Return(clientList); client = new Client(MockRepository.GenerateStub<IPlayer>()); client.Player.Stub(me => me.PlayerSettings).Return(MockRepository.GenerateStub<IPlayerSettings>()); client.Player.Stub(me => me.Weapons).Return(MockRepository.GenerateStub<IWeapons>()); client.Player.Weapons.Stub(me => me.Shots).Return(new Shots()); stubClientStateTracker.NetworkClients.Add(client); chatLog = new Log<ChatMessage>(); stubSnapCounter = MockRepository.GenerateStub<ISnapCounter>(); stubSnapCounter.CurrentSnap = 3; stubOutgoingMessageQueue = MockRepository.GenerateStub<IOutgoingMessageQueue>(); serverChatLogView = new GameStateSender(chatLog, stubClientStateTracker, stubSnapCounter, stubOutgoingMessageQueue); }
public void SetUp() { client = new LocalClient(null); clientLog = new Log<ChatMessage>(); stubClientStateTracker = MockRepository.GenerateStub<IClientStateTracker>(); chatLogQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>(); playerQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>(); playerSettingsMessageHelper = new QueuedMessageHelper<Item, ItemType>(); stubIncomingMessageQueue = MockRepository.GenerateStub<IIncomingMessageQueue>(); stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.ChatLog))).Do(chatLogQueueMessageHelper.GetNextQueuedMessage); stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.ChatLog)).Do(chatLogQueueMessageHelper.HasMessageAvailable); stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.Player))).Do(playerQueueMessageHelper.GetNextQueuedMessage); stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.Player)).Do(playerQueueMessageHelper.HasMessageAvailable); stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.PlayerSettings))).Do(playerSettingsMessageHelper.GetNextQueuedMessage); stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.PlayerSettings)).Do(playerSettingsMessageHelper.HasMessageAvailable); stubNetworkPlayerProcessor = MockRepository.GenerateStub<INetworkPlayerProcessor>(); chatLogProcessor = new GameStateProcessor(client, clientLog, stubNetworkPlayerProcessor, stubClientStateTracker, stubIncomingMessageQueue); }
public void SetUp() { stubIncomingMessageQueue = MockRepository.GenerateStub<IIncomingMessageQueue>(); chatLogQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>(); playerQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>(); playerSettingsQueueMessageHelper = new QueuedMessageHelper<Item, ItemType>(); stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.ChatLog))).Do(chatLogQueueMessageHelper.GetNextQueuedMessage); stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.ChatLog)).Do(chatLogQueueMessageHelper.HasMessageAvailable); stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.PlayerInput))).Do(playerQueueMessageHelper.GetNextQueuedMessage); stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.PlayerInput)).Do(playerQueueMessageHelper.HasMessageAvailable); stubIncomingMessageQueue.Stub(x => x.ReadItem(Arg<ItemType>.Is.Equal(ItemType.PlayerSettings))).Do(playerSettingsQueueMessageHelper.GetNextQueuedMessage); stubIncomingMessageQueue.Stub(x => x.HasAvailable(ItemType.PlayerSettings)).Do(playerSettingsQueueMessageHelper.HasMessageAvailable); stubClientStateTracker = MockRepository.GenerateStub<IClientStateTracker>(); stubNetworkPlayerProcessor = MockRepository.GenerateStub<INetworkPlayerProcessor>(); serverLog = new Log<ChatMessage>(); client = new Client(MockRepository.GenerateStub<IPlayer>()); client.Player.Stub(me => me.PlayerSettings).Return(MockRepository.GenerateStub<IPlayerSettings>()); clientInputProcessor = new ClientInputProcessor(stubNetworkPlayerProcessor, serverLog, stubClientStateTracker, stubIncomingMessageQueue); }
public IncomingMessageQueue(INetworkSession networkSession, IClientStateTracker clientStateTracker) { _networkSession = networkSession; _clientStateTracker = clientStateTracker; InitializeQueues(); }
public NetworkPlayerProcessor(IClientStateTracker clientStateTracker) { this.ClientStateTracker = clientStateTracker; }