示例#1
0
    public static void updatePlayer(Andor.Player p)
    {
        if (PV != null && PV.IsMine)
        {
            Debug.Log(Game.myPlayer.getNetworkID() + " ~ Updating Player...");

            PV.RPC("updatePlayer", RpcTarget.All, p);
        }
        else
        {
            Debug.Log(Game.myPlayer.getNetworkID() + " ~ Could not access PhotoView");
        }
    }
示例#2
0
    public static void addPlayer(Andor.Player p)
    {
        if (PV != null && PV.IsMine)
        {
            Debug.Log(Game.myPlayer.getNetworkID() + " ~ Adding Player...");

            PV.RPC("HOSTaddPlayer", RpcTarget.MasterClient, p);
        }
        else
        {
            Debug.Log(Game.myPlayer.getNetworkID() + " ~ Could not access PhotoView");
        }
    }
示例#3
0
    public static void initGame(Andor.Player player, bool addPlayer = true)
    {
        myPlayer  = player;
        gameState = new GameState();


        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(Player), 1, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(List <Player>), 2, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(List <string>), 3, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(Move), 4, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(PassTurn), 5, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(EndTurn), 6, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);

        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(InitiateTrade), 7, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(RespondTrade), 8, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        //If you want to send something through the network, you need to execute this command and create the corresponding class
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(MovePrinceThorald), 9, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(BuyFromMerchant), 10, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(EmptyWell), 11, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(BuyBrew), 12, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(SendChat), 13, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(UseTelescope), 14, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);

        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(Interact), 15, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(UseWineskin), 16, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);

        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(InviteFighter), 17, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(RespondFight), 18, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(StartFight), 19, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(UseWitchBrew), 20, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(UseHelm), 21, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(UseShield), 22, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(UseBow), 23, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);

        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(EndFight), 24, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(FightTurn), 25, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(ExitFight), 26, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);

        // ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(MovePrinceThorald), 9, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(JoinNextRound), 27, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(CreatureTurn), 28, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(WinBattle), 29, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(DistributeReward), 30, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(GetMyReward), 31, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(InstantiateMedicinalHerb), 32, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(RemoveMonster), 33, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(DistributeBoard), 34, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(SetSkralStronghold), 35, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);
        ExitGames.Client.Photon.PhotonPeer.RegisterType(typeof(SetRunestoneLegend), 36, NetworkHandler.SerializeThis, NetworkHandler.Deserialize);


        // MUST HAVE PV
        gameState.addPlayer(myPlayer);
        Game.addPlayer(myPlayer);

        int[] randomEventOrder = event_cards;
        randomEventOrder.Shuffle();
        //event_cards2 = randomEventOrder;
        Debug.Log("STARTING TO SET EVENT CARD ORDER");
        Game.setEventCardOrder(randomEventOrder);
        Debug.Log("FINISHING TO SET EVENT CARD ORDER");
        string[] randomFogTokenOrder = fogTokens;
        randomFogTokenOrder.Shuffle();
        //fogTokens2 = randomFogTokenOrder;
        Debug.Log("STARTING TO SET FOG ORDER");
        Game.setFogTokenOrder(randomFogTokenOrder);
        Debug.Log("FINISHING TO SET FOG ORDER");


        Debug.Log("Initialized Game!");
    }