public void ClientAction(GameSession gameSession) { //Remove all associated entities gameSession.gameMap.RemoveClientEntities(clientIndex); PeerClientInfo peerClientInfo = gameSession.NetworkManager.GetClientInfo(clientIndex); if (peerClientInfo != null) { gameSession.graphicsUI.MessageManager.AddMessage(peerClientInfo.Username + " has disconnected!"); } else { gameSession.graphicsUI.MessageManager.AddMessage("Client " + clientIndex + " has disconnected!"); } }
public void LoadPlayer(PlayerStandards.PlayerType playerType, GameSession gameSession, Lobby lobby, int clientIndex, int entityIndex) { //Ensure unloaded if (spriteManager == null) { this.playerType = playerType; PlayerTexturePack texturePack = PlayerStandards.PlayerTypes[(int)playerType].LoadTexturePack(Content, graphicsDevice); spriteManager = new SpriteManager(texturePack, gameSession.LatestGameTime); drawDimensions = new Vector2(PlayerStandards.PlayerTypes[(int)playerType].GetPlayerScale() * MapStandards.PLAYER_SCALE, PlayerStandards.PlayerTypes[(int)playerType].GetPlayerScale() * MapStandards.PLAYER_SCALE); polygonalRepresentation = new RotationRectangle(new RectangleF(PlayerPosition.X - (DrawDimensions.X / 2), PlayerPosition.Y - (DrawDimensions.Y / 2), DrawDimensions.X, DrawDimensions.Y)); playerParticleManager = new PlayerParticleManager(texturePack, polygonalRepresentation, DrawDimensions); clientInfo = gameSession.NetworkManager.GetClientInfo(clientIndex); if (clientInfo != null) { healthBar = gameSession.graphicsUI.HealthBarManager.AddHealthBar(clientInfo.Username, Player.PLAYER_HEALTH, gameSession.LatestGameTime); } else { throw new Exception("Error with client info!"); } } }
public PeerClientInfoMessage(PeerClientInfo peerClientInfo) { this.peerClientInfo = peerClientInfo; }
public void AddPeerClientInfo(PeerClientInfo peerClientInfo) { peerClientInfos.Add(peerClientInfo); }