Пример #1
0
        public override void OnRead(RiftClient From)
        {
            Log.Success("SelectRequest", "Enter on World : " + From.GetIp + ",GUID=" + GUID);

            Character Char = CharacterMgr.Instance.GetCharacter((int)GUID);

            if (Char.AccountId != From.Acct.Id)
            {
                From.Disconnect();
                return;
            }

            From.Acct.PendingCharacter = GUID;
            From.Acct.Dirty            = true;
            AccountMgr.AccountDB.SaveObject(From.Acct);

            LobbyCharacterSelectResponse Rp = new LobbyCharacterSelectResponse();

            if (From.Realm != null)
            {
                Log.Success("Entering", "On : " + From.Realm.Address);
                Rp.Ips.Add(From.Realm.Address);
            }

            From.SendSerialized(Rp);
        }
        public override void OnRead(RiftClient From)
        {
            Log.Success("SelectRequest","Enter on World : " + From.GetIp + ",GUID=" + GUID);

            Character Char = CharacterMgr.Instance.GetCharacter((int)GUID);

            if (Char.AccountId != From.Acct.Id)
            {
                From.Disconnect();
                return;
            }

            From.Acct.PendingCharacter = GUID;
            From.Acct.Dirty = true;
            AccountMgr.AccountDB.SaveObject(From.Acct);

            LobbyCharacterSelectResponse Rp = new LobbyCharacterSelectResponse();
            if (From.Realm != null)
            {
                Log.Success("Entering", "On : " + From.Realm.Address);
                Rp.Ips.Add(From.Realm.Address);
            }

            From.SendSerialized(Rp);
        }
        public override void OnRead(RiftClient From)
        {
            Log.Success("SelectRequest", "Enter on World : " + From.GetIp + ",GUID=" + GUID);

            if (From.Acct == null || From.Rm == null)
                return;

            Character Char = From.Rm.GetObject<CharactersMgr>().GetCharacter(GUID);
            if (Char == null || Char.AccountId != From.Acct.Id)
            {
                Log.Error("SelectRequest", "Invalid CharacterId = " + GUID);
                From.Disconnect();
                return;
            }

            MapServerInfo Info = From.Rm.GetObject<WorldMgr>().GetMapInfo();

            if (Info == null)
            {
                Log.Error("SelectRequest", "No map loaded ! Run MapServer");
                return;
            }

            Log.Success("SelectRequest", "Entering on Map : " + Info.MapAdress);

            Info.GetObject<MapMgr>().RegisterConnecting(From.Acct.Username,Char.CharacterId);

            LobbyCharacterSelectResponse Rp = new LobbyCharacterSelectResponse();
            Rp.Ips.Add(Info.MapAdress);
            From.SendSerialized(Rp);
        }
        public override void OnRead(RiftClient From)
        {
            Log.Success("SelectRequest", "Enter on World : " + From.GetIp + ",GUID=" + GUID);

            if (From.Acct == null || From.Rm == null)
            {
                Log.Error("LobbyCharacterSelectRequest", "Acct or Rm == null");
                return;
            }

            Character Char = From.Rm.GetObject <CharactersMgr>().GetCharacter(GUID);

            if (Char == null || Char.AccountId != From.Acct.Id)
            {
                Log.Error("SelectRequest", "Invalid CharacterId = " + GUID);
                From.Disconnect();
                return;
            }


            MapServerInfo Info = From.Rm.GetObject <WorldMgr>().GetMapInfo();

            if (Info == null)
            {
                Log.Error("SelectRequest", "No map loaded ! Run MapServer");
                return;
            }

            Log.Success("SelectRequest", "Entering on Map : " + Info.MapAdress);

            Info.GetObject <MapMgr>().RegisterConnecting(From.Acct.Username, Char.CharacterId);

            LobbyCharacterSelectResponse Rp = new LobbyCharacterSelectResponse();

            Rp.Ips.Add(Info.MapAdress);
            From.SendSerialized(Rp);
        }