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); }
public LoginManager(Runner runner, Session session, IDatabaseAccessLayer dal) { this.runner = runner; this.session = session; this.dal = dal; }
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. "); }