public void ShareKnowledge(int PlayerID, PlayerCard Card) { RaiseEventOptions opt = new RaiseEventOptions { Receivers = ReceiverGroup.All }; ///send playerid senderid card hashcode and a placeholder for request /// byte[] content = { (byte)PlayerID, (byte)PhotonNetwork.player.ID, (byte)Card.GetHashCode(), (byte)1 }; for (int i = 0; i < 4; i++) { //shareKnowledgeRequestContent[i] = content[i]; } Debug.Log(content.Length); string debug = ""; for (int i = 0; i < 3; i++) { debug += content[i].ToString() + " "; } Debug.Log("in ShareKnoledge " + debug); PhotonNetwork.RaiseEvent((byte)103, content, true, opt); }
public void OnClickReseashStation() { ActionButton.gameObject.SetActive(false); City CurrentCity = (City)ActionButton.CurrentCity.GetComponent("City"); PlayerCard card = (PlayerCard)CurrentCity.cityNumber; RaiseEventOptions opt = new RaiseEventOptions { Receivers = ReceiverGroup.All }; if (CurrentCity.HasResearchStation()) { return;//if city has research station already then exit } if (currentPlayer.PlayerRole == Role.OperationsExpert) { PhotonNetwork.RaiseEvent((byte)123, card.GetHashCode(), true, opt); ActionCallBack(); return; } if (!currentPlayer.HasCard(card) || !currentPlayer.CurrentCity.Equals(ActionButton.CurrentCity)) { return;//if player does not have card required to build research station then exit } currentPlayer.Discard(card); deck.PutInDiscardPile(card); hand.GetCurrentHand(PhotonNetwork.player.ID); //CurrentCity.SetResearchStation(PlaceResearchStation(ActionButton.CurrentCity, ResearchStation)); //Instantiate(ResearchStation) PhotonNetwork.RaiseEvent((byte)123, card.GetHashCode(), true, opt); ActionCallBack(); }
public void SelectCardCallBack(PlayerCard TradeCard) { if (OnShareKnowledge) { ShareKnowledge(1, TradeCard); OnShareKnowledge = false; hand.ChooseCardModeOff();// choose card to share return; } RaiseEventOptions opt = new RaiseEventOptions { Receivers = ReceiverGroup.All }; PhotonNetwork.RaiseEvent((byte)110, TradeCard.ToString(), true, opt); PhotonNetwork.RaiseEvent((byte)77, TradeCard.GetHashCode(), true, opt); ActionCallBack(); }