void c_ClientLogin(object sender, ClientLoginEventArgs e) { if (ClientLogin != null) { ClientLogin(sender, e); } Client c = (Client)sender; GameLogin g = e.GameLoginDetails; int accountId = -1; if (accountManager.LoginVerification(g.AccountName, ref accountId)) { byte[] bufferLoginState = PacketManager.SendLoginState(LoginState.Success, accountId); c.Send(bufferLoginState); byte[] bufferWorldList = PacketManager.SendWorldList(worldInfos); c.Send(bufferWorldList); } else { byte[] bufferLoginState = PacketManager.SendLoginState(LoginState.Failure, 0); c.Send(bufferLoginState); } //do c.Send() with w/e you need here }
private void HandleRecvGameLogin(Packet parsed) { GameLogin g = PacketManager.RecvGameLogin(parsed); if (ClientLogin != null) { ClientLogin(this, new ClientLoginEventArgs(g, parsed)); } }
public static int GameLoginAdd(int iUserID, string sGameName, string sLoginIP, string sLoginUrl) { GameLoginTodayBLL.GameLoginAdd(iUserID, sLoginIP, sGameName); GameLogin glObject = new GameLogin(); glObject.UserID = iUserID; glObject.GameName = sGameName; glObject.LoginIp = sLoginIP; glObject.LoginUrl = sLoginUrl; return(GameLoginDAL.GameLoginAdd(glObject)); }
public static int GameLoginAdd(GameLogin glObject) { Database dbDCenter = DatabaseFactory.CreateDatabase(sConn); DbCommand dcGameLogin = dbDCenter.GetStoredProcCommand("SP_GameLogin_Add"); dbDCenter.AddInParameter(dcGameLogin, "@userid", DbType.Int32, glObject.UserID); dbDCenter.AddInParameter(dcGameLogin, "@gamename", DbType.String, glObject.GameName); dbDCenter.AddInParameter(dcGameLogin, "@loginip", DbType.String, glObject.LoginIp); dbDCenter.AddInParameter(dcGameLogin, "@loginurl", DbType.String, glObject.LoginUrl); return(dbDCenter.ExecuteNonQuery(dcGameLogin)); }
private IGameStage GetStage(GAMESTAGE e) { IGameStage stage = null; switch (e) { case GAMESTAGE.GAMESTAGE_LOGIN: stage = new GameLogin(); break; case GAMESTAGE.GAMESTAGE_MAIN: break; default: break; } return(stage); }
public static void InvokeGameLogin(GameLoginEventArgs e) => GameLogin?.Invoke(e);
void OnDisable() { Instance = null; }
void OnEnable() { Instance = this; }
public ClientLoginEventArgs(GameLogin gameLogin, Packet p) { this.gameLogin = gameLogin; }
public static int GameLoginAdd(GameLogin glObject) { return(GameLoginDAL.GameLoginAdd(glObject)); }