Exemple #1
0
        // local case
        public override void OnStartLocalClient(GameServer server)
        {
            base.OnStartLocalClient(server);

            instance      = this;
            this.tbServer = (TurnBasedServer)server;

            if (mode == Mode.OfflineMode)
            {
                var players = new Dictionary <uint, TBPlayer>();

                // TODO!!!
                foreach (var p in DualNetworkManager.instance.OfflinePlayers())
                {
                    var pp  = (OfflinePlayer)p;
                    var tbp = pp.GetComponent <TBPlayer>();
                    players.Add(p.GetId(), tbp);
                }

                clientPlayers = new FixedClientPlayers <TBPlayer>(players);
            }
            else
            {
                clientPlayers = new CacheClientPlayers <TBPlayer>();
            }
        }
Exemple #2
0
        protected override void OnStartServer()
        {
            base.OnStartServer();

            instance = this;

            this.roleData = new RoleData[numRoles];

            for (int r = 0; r < numRoles; r++)
            {
                this.roleData[r] = new RoleData();
            }
        }