Exemplo n.º 1
0
        // If a commander joins our side, then change autodonate to that player, and donate all your money!
        private void _messageReceiver_FMD_S_JOIN_SIDE(ClientConnection client, AllegianceInterop.FMD_S_JOIN_SIDE message)
        {
            if (message.shipID == client.GetShip().GetObjectID())
            {
                return;
            }

            if (client.GetSide()?.GetShip(message.shipID)?.GetName().EndsWith("com@BOT") == true)
            {
                SetAutoDonateAndDonateAllMoneyToTeamLeader(client.GetSide()?.GetShip(message.shipID));
            }
            else
            {
                Log($"New player joined side: {client.GetSide()?.GetShip(message.shipID)?.GetName()}");
            }
        }
Exemplo n.º 2
0
        private void MessageReceiver_FMD_S_JOIN_SIDE(ClientConnection client, AllegianceInterop.FMD_S_JOIN_SIDE message)
        {
            AllegianceInterop.FMD_S_PLAYERINFO playerInfo;
            if (_shipID == message.shipID)
            {
                Log($"Player joined side {message.sideID}");

                //playerInfo.iSide = message.sideID;

                if (message.sideID != SideIndex)
                {
                    AllegianceInterop.FMD_C_POSITIONREQ positionRequest = new AllegianceInterop.FMD_C_POSITIONREQ(SideIndex);
                    client.SendMessageServer(positionRequest);
                }
                else
                {
                    if (IsCommander == true)
                    {
                        AllegianceInterop.FMD_CS_SET_TEAM_LEADER setTeamLeader = new AllegianceInterop.FMD_CS_SET_TEAM_LEADER(message.sideID, message.shipID);
                        client.SendMessageServer(setTeamLeader);
                    }

                    if (IsGameController == true)
                    {
                        AllegianceInterop.FMD_CS_SET_MISSION_OWNER setMissionOwner = new AllegianceInterop.FMD_CS_SET_MISSION_OWNER(message.sideID, message.shipID);
                        client.SendMessageServer(setMissionOwner);
                    }
                }
            }

            //if (_playerInfoByShipID.ContainsKey(message.shipID) == true)
            //{
            //    // If we receive an update for our player, and our player is the game controller and was not already on the team they are joining, then reset the game parameters.
            //    //if (_isGameController == true && _playerInfoByShipID[message.shipID].CharacterName == _playerName && _playerInfoByShipID[message.shipID].iSide != message.sideID && message.sideID >= 0)
            //    //    ResetGameParameters(client);

            //    _playerInfoByShipID[message.shipID].iSide = message.sideID;
            //}
        }