コード例 #1
0
ファイル: User.cs プロジェクト: btasdoven/ScienceWars
        public User(Session session, string username, int physicsSciencePoint, int chemSciencePoint, int biologySciencePoint, bool[] unlockedScienceNodes)
        {
            id = idGenerator++;

            // bi sekilde ya databaseden okumak lazim ya da ...
            selectedBoardTypeId = 0;

            this.unlockedScienceNodes = unlockedScienceNodes;
            setUnlockedMinionsAndTowers(unlockedScienceNodes);  // aslinda lock kullanmak lazim. ancak herkes reader oldugu icin, hic writer olmadigi icin mutex kullanmaya gerek yok.

            this.session = session;
            this.username = username;
            this.physicsSciencePoint = physicsSciencePoint;
            this.chemistrySciencePoint = chemSciencePoint;
            this.biologySciencePoint = biologySciencePoint;

            LoginResult.sendMessage(this, true);
            EnterLobby.sendMessage(this);
        }
コード例 #2
0
ファイル: LoginManager.cs プロジェクト: btasdoven/ScienceWars
 public LoginManager(Runner runner, Session session, IDatabaseAccessLayer dal)
 {
     this.runner = runner;
     this.session = session;
     this.dal = dal;
 }
コード例 #3
0
ファイル: Runner.cs プロジェクト: btasdoven/ScienceWars
        void server_clientArrivedEvent(object sender, ClientEventArgs e)
        {
            Session ses = new Session(e.client);
            LoginManager loginManager = new LoginManager(this, ses, dal);
            loginManager.launch();

            Console.WriteLine("Client arrived and redirected to LoginManager. ");
        }