Exemplo n.º 1
0
        public void CheckGameVersion()
        {
            stCheckVerisonCmd checkVersion;

            checkVersion.data    = 0;
            checkVersion.version = GameVersion;
            var server = ServiceCenter.GetService <IGiantFreeServer>();

            server.SendMessage(stCheckVerisonCmd.byCmd, stCheckVerisonCmd.byParam, CmdSerializer.StructToBytes(checkVersion));
        }
Exemplo n.º 2
0
        private byte[] GetCommandBuffer()
        {
            byte[] ncm      = CmdSerializer.StructToBytes(this.bmdParamTime);
            int    totalLen = ncm.Length;

            if (this.bodyData != null)
            {
                totalLen += this.bodyData.Length;
            }

            byte[] con = new byte[totalLen];
            Array.Copy(ncm, con, ncm.Length);
            Array.Copy(this.bodyData, 0, con, ncm.Length, totalLen - ncm.Length);
            return(con);
        }
Exemplo n.º 3
0
        public void LoginFirServer()
        {
            Logger <IGiantFreeServer> .L("正在登录Fir Server...");

            stRequestLoginCmd loginCmd = new stRequestLoginCmd();

            loginCmd.strName = this.loginModule.Account;

            byte len = this.loginModule.Password[0];

            byte[] szPass = new byte[34];
            for (int i = 0; i < (len + 1); i++)
            {
                szPass[i] = this.loginModule.Password[i];
            }
            this.UseIPEncry(ref szPass, len + 1);

            loginCmd.strPassword = new byte[33];
            Array.Copy(szPass, loginCmd.strPassword, 33);
            loginCmd.game       = this.loginModule.GameType;
            loginCmd.zone       = this.loginModule.ZoneID;
            loginCmd.macAddress = "74D02BC4CE2B";
            loginCmd.uuid       = "))L1?o1?L1????z/ 2?";
            loginCmd.wdNetType  = 0;

            this.loginModule._SendMessage(stRequestLoginCmd.byCmd, stRequestLoginCmd.byParam, CmdSerializer.StructToBytes(loginCmd));
        }
Exemplo n.º 4
0
        private void OnConnectFirSuccess()
        {
            Logger <IGiantFreeServer> .L("连接Fir Server成功");

            this.loginModule.CheckGameVersion();

            stRequestClientIPCmd requestIP;

            this.loginModule._SendMessage(stRequestClientIPCmd.byCmd, stRequestClientIPCmd.byParam, CmdSerializer.StructToBytes(requestIP));
        }
Exemplo n.º 5
0
        public void SendGateWayLogin()
        {
            Logger <IGiantFreeServer> .L("正在登录GameServer...");

            stPasswordLoginCmd cmd;

            cmd.strName = new byte[48];

            cmd.userID     = this.loginModule.UserID;
            cmd.loginTmpID = this.loginModule.UserTmpID;
            byte[] tmp = Encoding.UTF8.GetBytes(this.loginModule.Account);
            Array.Copy(tmp, cmd.strName, tmp.Length);
            cmd.strPassword = "";

            this.loginModule._SendMessage(stPasswordLoginCmd.byCmd, stPasswordLoginCmd.byParam, CmdSerializer.StructToBytes(cmd));
        }
Exemplo n.º 6
0
        private void SendUserGameTime()
        {
            UserResponseGameTimeCmd cmd;
            ulong serverTime = this.GetServerTime();

            cmd.userTmpID = this.loginModule.UserTmpID;
            cmd.gameTime  = serverTime;
            var server = ServiceCenter.GetService <IGiantFreeServer>();

            server.SendMessage(UserResponseGameTimeCmd.byCmd, UserResponseGameTimeCmd.byParam, CmdSerializer.StructToBytes(cmd));
        }