Beispiel #1
0
    public void OnButtonLogonClick()
    {
        Debug.Log("OnButtonLogonClick");
        //Hide();
        //PanelManager.me.Get((int)PanelId.PanelMain).Show();
        username = controls.GetInputField("InputFieldUsername");
        password = controls.GetInputField("InputFieldPassword");
        ReqLogon reqLogon = new ReqLogon();

        reqLogon.Username = username.text;
        reqLogon.Password = password.text;
        //Net.me.Send(reqLogon);
        Net.me.Send2(reqLogon);
    }
Beispiel #2
0
    static int set_Password(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ReqLogon obj  = (ReqLogon)o;
            string   arg0 = ToLua.CheckString(L, 2);
            obj.Password = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Password on a nil value" : e.Message));
        }
    }
Beispiel #3
0
    static int get_Password(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ReqLogon obj = (ReqLogon)o;
            string   ret = obj.Password;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Password on a nil value" : e.Message));
        }
    }
Beispiel #4
0
        public static void OnPacket(Client client, object pack)
        {
            ReqLogon  req       = pack as ReqLogon;
            UserLogon userLogon = new UserLogon();

            userLogon.UserInfo  = UserSystem.me.GetByUsernameAndPassword(req.Username, req.Password);
            userLogon.ErrorCode = userLogon.UserInfo != null ? 0 : 1;
            if (userLogon.ErrorCode == 0)
            {
                userLogon.UserInfo.HeroList = HeroSystem.me.AllHeros(userLogon.UserInfo.Id);
            }
            client.Send(userLogon);
            return;

            //string cmd = String.Format("SELECT * FROM `user` WHERE Username='******'", "test0");
            //MySqlDataReader reader = Database.me.ExecQuery(cmd);
            //if (reader.Read())
            ////if (reader.NextResult())
            //{
            //    client.SetStatus(Client.Status.InHall);
            //    client.userid = ++Client.userIdCounter;
            //    UserLogon userLogon = new UserLogon();
            //    userLogon.UserId = client.userid;
            //    userLogon.UserInfo = new UserInfo();
            //    userLogon.UserInfo.Id = 0;
            //    userLogon.UserInfo.Username = reader.GetString("Username");
            //    userLogon.UserInfo.Coin = 11;
            //    userLogon.UserInfo.Diamond = 12;
            //    userLogon.UserInfo.Vigour = 13;
            //    userLogon.UserInfo.VipLevel = 14;
            //    userLogon.UserInfo.TeamLevel= 15;
            //    userLogon.UserInfo.BattlePower = 16;


            //    userLogon.UserInfo.Coin = 12;

            //    client.Send(userLogon);
            //}
            //reader.Close();
        }
Beispiel #5
0
    static int _CreateReqLogon(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                ReqLogon obj = new ReqLogon();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: ReqLogon.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }