Exemple #1
0
        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
        }
Exemple #2
0
        private void HandleRecvGameLogin(Packet parsed)
        {
            GameLogin g = PacketManager.RecvGameLogin(parsed);

            if (ClientLogin != null)
            {
                ClientLogin(this, new ClientLoginEventArgs(g, parsed));
            }
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        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));
        }
Exemple #5
0
    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);
    }
Exemple #6
0
 public static void InvokeGameLogin(GameLoginEventArgs e) => GameLogin?.Invoke(e);
Exemple #7
0
 void OnDisable()
 {
     Instance = null;
 }
Exemple #8
0
 void OnEnable()
 {
     Instance = this;
 }
Exemple #9
0
 public ClientLoginEventArgs(GameLogin gameLogin, Packet p)
 {
     this.gameLogin = gameLogin;
 }
Exemple #10
0
 public static int GameLoginAdd(GameLogin glObject)
 {
     return(GameLoginDAL.GameLoginAdd(glObject));
 }