Exemplo n.º 1
0
        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!");
            }
        }
Exemplo n.º 2
0
        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!");
                }
            }
        }
Exemplo n.º 3
0
 public PeerClientInfoMessage(PeerClientInfo peerClientInfo)
 {
     this.peerClientInfo = peerClientInfo;
 }
Exemplo n.º 4
0
 public void AddPeerClientInfo(PeerClientInfo peerClientInfo)
 {
     peerClientInfos.Add(peerClientInfo);
 }