Beispiel #1
0
 public GameC(STGameApp app) : base(app, 2)
 {
     GAME_SPAN    = 600000; // 10min
     ROUND_SPAN   = GAME_SPAN;
     END_SPAN     = 3000;
     Client_Limit = 20;
 }
Beispiel #2
0
        public STServerPeer(IRpcProtocol rpcProtocol, IPhotonPeer nativePeer, STGameApp ga)
            : base(rpcProtocol, nativePeer)
        {
            game_app = ga;

            this.fiber = new PoolFiber();
            this.fiber.Start();
        }
Beispiel #3
0
        public GameB(STGameApp app) : base(app, 1)
        {
            WAIT_SPAN = 60000;
            RUN_SPAN  = 100000;

            GAME_SPAN  = 600000;               // whole game_b time, 10 min
            ROUND_SPAN = WAIT_SPAN + RUN_SPAN; //each round 1:40 + 1:00(wait)

            END_SPAN     = 2000;
            Client_Limit = 2;



            resetWaitingList();
        }
Beispiel #4
0
        public GameA(STGameApp app) : base(app, 0)
        {
            GAME_SPAN  = 600000; // 10min
            ROUND_SPAN = 595000; // 9:55

            INTERACTIVE_SPAN = 180000;

            TIMEOUT_SPAN = 300000;

            END_SPAN     = 5000;
            Client_Limit = 10;

            right_online_client = new Hashtable();
            left_online_client  = new Hashtable();
        }
Beispiel #5
0
        public GameScene(STGameApp app, int game_type)
        {
            game_app      = app;
            online_client = new List <STServerPeer>();
            // online_client = new SynchronizedCollection<STServerPeer>();

            ingame_id = new List <String>();

            // open db

            if (app.enable_db)
            {
                sql_connection = app.getSqlConnection();
                setupSqlCommand(Insert_Command[game_type]);
            }
        }
Beispiel #6
0
        protected override void Setup()
        {
            //server init
            LogManager.SetLoggerFactory(Log4NetLoggerFactory.Instance);
            GlobalContext.Properties["LogFileName"] = this.ApplicationName + System.DateTime.Now.ToString("yyyy-MM-dd-hh-mm");
            XmlConfigurator.ConfigureAndWatch(new FileInfo(Path.Combine(BinaryPath, "log4net.config")));

            Log.Debug("!!! STPhotonServer Start !!!");

            lconnected_peer = new List <PeerBase>();
            game_app        = new STGameApp(lconnected_peer);


            //Timer timer=new Timer(2000);
            //timer.Elapsed+=new ElapsedEventHandler(sendToAll);
            //timer.AutoReset=true;
            //timer.Enabled=true;
        }