private void MessageReceiver_FMD_S_AUTODONATE(ClientConnection client, AllegianceInterop.FMD_S_AUTODONATE message) { // If we are supposed to be the commander and we get an "auto-donate message", force ourselves into the commander seat! // This also steals all the money from all the other players. if (IsCommander == true && message.sidDonateTo != client.GetShip().GetObjectID()) { AllegianceInterop.FMD_CS_SET_TEAM_LEADER setTeamLeader = new AllegianceInterop.FMD_CS_SET_TEAM_LEADER(client.GetSide().GetObjectID(), client.GetShip().GetObjectID()); client.SendMessageServer(setTeamLeader); } if (IsGameController == true && message.sidDonateTo != client.GetShip().GetObjectID()) { AllegianceInterop.FMD_CS_SET_MISSION_OWNER setMissionOwner = new AllegianceInterop.FMD_CS_SET_MISSION_OWNER(client.GetSide().GetObjectID(), client.GetShip().GetObjectID()); client.SendMessageServer(setMissionOwner); } }
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; //} }
private void MessageReceiver_FMD_CS_SET_MISSION_OWNER(ClientConnection client, AllegianceInterop.FMD_CS_SET_MISSION_OWNER message) { if (message.shipID == _shipID) { Log("This player is now the game controller (mission owner), resetting mission parameters."); ResetGameParameters(client); } }