Exemple #1
0
        private void GetData(BaseProto _data)
        {
            Console.WriteLine("GetData:" + _data.GetType().ToString());

            if (userService != null)
            {
                Action <SuperUserServiceBase> callBack = delegate(SuperUserServiceBase _service)
                {
                    _service.GetData(_data);
                };

                userService.Process(callBack);
            }
            else
            {
                LoginProto loginProto = _data as LoginProto;

                Action <UserManager> callBack = delegate(UserManager _service)
                {
                    _service.Login(loginProto.userName, loginProto.password, this);
                };

                UserManager.Instance.Process(callBack);
            }
        }
Exemple #2
0
        public static unsafe Error LoginUser(LoginProto login)
        {
            var buffer = login.ToByteArray();

            fixed(byte *p = buffer)
            {
                IntPtr ptr       = (IntPtr)p;
                var    protoMsgC = new ProtoMessageC
                {
                    data = new SWIGTYPE_p_void(ptr, false),
                    len  = (uint)buffer.Length
                };
                var sdkReturn = animus_client_sdk.LoginUserGo(protoMsgC);

                if (sdkReturn == null)
                {
                    return(new Error {
                        Success = false
                    });
                }

                var err = new Error();

                err.MergeFrom(sdkReturn.GetBytes());
                return(err);
            }
        }
Exemple #3
0
    public void Click()
    {
        LoginProto login = new LoginProto();

        login.userName = inputName.text;

        login.password = inputPwd.text;

        SuperSocket.Instance.SendData <LoginResultProto> (login, LoginOver);
    }
Exemple #4
0
    private void DoLogin(int code)
    {
        LogUtil.Log("DoLogin!!!");
        LoginProto loginProto = new LoginProto()
        {
            account  = SDKWrapper.instance.GetAccount(),
            code     = code,
            gameType = int.Parse(FileHelper.ReadConfig("GameType"))
        };
        string signStr = Util.GetMd5EncryptStr(loginProto.account + loginProto.code + GameManager.SECRET);

        loginProto.sign = signStr;
        //发送信息向服务器端
        HallSocketWrapper.instance.DoSocketRequest(10001, loginProto, 20002, 20003);
    }
    private ProtoMessage Build_LoginProto(string sessionID, string userID, string userType, int serverID, int thirdPartyID, string extraStr,
                                          string systeminfo, string versionString)
    {
        LoginProto proto = new LoginProto
        {
            loginsession  = sessionID,
            userid        = userID,
            usertype      = userType,
            serverid      = serverID,
            thirdpartyid  = thirdPartyID,
            stringValue1  = extraStr,
            systemInfo    = systeminfo,
            clientVersion = versionString
        };

        return(Client.Instance.SerializeMsg <LoginProto>(ProtoMsgDefine.C2S_LOGIN, proto));
    }
Exemple #6
0
    private void DoHandleNoticeLogin(NoticeLoginProto proto)
    {
        LogUtil.Log("提示登录!!!proto.code = " + proto.code);
        if (HandleNoticeLogin == null)
        {
            return;
        }
        //HandleNoticeLogin.GetInvocationList().Length == 1说明为断线重连,重新登录,并且在有登录(如gamemanager)的界面不执行此内容

        LogUtil.Log("DoLogin!!!  HallSocketWrapper");
        LoginProto loginProto = new LoginProto()
        {
            account     = SDKWrapper.instance.GetAccount(),
            code        = proto.code,
            gameType    = int.Parse(FileHelper.ReadConfig("GameType")),
            connectType = 0
        };
        string signStr = Util.GetMd5EncryptStr(loginProto.account + loginProto.code + GameManager.SECRET);

        loginProto.sign = signStr;
        //发送信息向服务器端
        DoSocketRequest(10001, loginProto, 20002, 20003);
    }
        private void ThreadedLogin(string username, string password)
        {
            loginResultAvailable = false;
            var loginProto = new LoginProto();

            loginProto.Password     = password;
            loginProto.Username     = username;
            loginProto.SystrayLogin = false;

            var loginErr = AnimusClient.AnimusClient.LoginUser(loginProto);

            loginReturn          = loginErr.Description;
            loginSuccess         = loginErr.Success;
            loginResultAvailable = true;
            if (!loginErr.Success)
            {
                Debug.Log("Login error: " + loginReturn);
            }
            else
            {
                Debug.Log("Login successful");
            }
        }