Erno Erno  • 24.04.15 17:50

[Tutorial] Tirando bug do "tele" [Tutorial] Empty [Tutorial] Tirando bug do "tele" [Tutorial] 24.04.15 17:50

Reputação da mensagem: 100% (1 votos)
Bom Usuários da Power Pixel, vi que alguns usuários estão com problemas devido a um bug muito chato que atrapalha e incomoda a todos, que é o bug do "tele".

O problema é que, apesar de existir o fix, muitos emuladores mercury ainda carregam o erro (Ex: Mercury Original, Mercury Space, Silver, Revision 2 e 3.

O bug é o seguinte: Ao clicar 2x em um teleporte e clicar em seguida em outro piso, o usuário passa a estar o usando o comando tele em qualquer quarto.


Vamos ao Tutorial:


1. Baixe um editor para open source do seu emulador. (Visual Studio)


2. Baixado o programa, abra todo o projeto. Use CTRL + F e procure pelo código:

Código:
case InteractionType.teleport: {
bool flag3 = false;

3. Substitua todo o InteractionType.teleport pelo código:



Código:
case InteractionType.teleport: {
bool flag3 = false;
bool flag4 = false;
if (this.InteractingUser > 0)
{
RoomUser roomUserByHabbo2 = this.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(this.InteractingUser);
if (roomUserByHabbo2 == null)
{
this.InteractingUser = 0u;
return;
}
if (roomUserByHabbo2.Coordinate == this.Coordinate)
{
roomUserByHabbo2.AllowOverride = false;
if (TeleHandler.IsTeleLinked(this.Id, this.mRoom))
{
flag4 = true;
uint linkedTele = TeleHandler.GetLinkedTele(this.Id, this.mRoom);
uint teleRoomId = TeleHandler.GetTeleRoomId(linkedTele, this.mRoom);
if (teleRoomId == this.RoomId)
{
RoomItem item2 = this.GetRoom().GetRoomItemHandler().GetItem(linkedTele);
if (item2 == null)
{
roomUserByHabbo2.UnlockWalking();
}
else
{
roomUserByHabbo2.SetPos(item2.GetX, item2.GetY, item2.GetZ);
roomUserByHabbo2.SetRot(item2.Rot, false);
item2.ExtraData = "2";
item2.UpdateState(false, true);
item2.InteractingUser2 = this.InteractingUser;
}
}
else
{
if (!roomUserByHabbo2.IsBot && roomUserByHabbo2 != null && roomUserByHabbo2.GetClient() != null && roomUserByHabbo2.GetClient().GetHabbo() != null && roomUserByHabbo2.GetClient().GetMessageHandler() != null)
{
roomUserByHabbo2.GetClient().GetHabbo().IsTeleporting = true;
roomUserByHabbo2.GetClient().GetHabbo().TeleportingRoomID = teleRoomId;
roomUserByHabbo2.GetClient().GetHabbo().TeleporterId = linkedTele;
roomUserByHabbo2.GetClient().GetMessageHandler().PrepareRoomForUser(teleRoomId, "");
}
}
this.InteractingUser = 0u;
}
else
{
roomUserByHabbo2.UnlockWalking();
this.InteractingUser = 0u;
roomUserByHabbo2.CanWalk = false;
roomUserByHabbo2.TeleportEnabled = false;
roomUserByHabbo2.MoveTo(this.SquareInFront);
roomUserByHabbo2.CanWalk = true;
}
}
else
{
if (roomUserByHabbo2.Coordinate == this.SquareInFront)
{
roomUserByHabbo2.AllowOverride = true;
flag3 = true;
if (roomUserByHabbo2.IsWalking && (roomUserByHabbo2.GoalX != this.mX || roomUserByHabbo2.GoalY != this.mY))
{
roomUserByHabbo2.ClearMovement(true);
}
roomUserByHabbo2.SetRot(PathFinding.PathFinder.CalculateRotation(roomUserByHabbo2.X, roomUserByHabbo2.Y, this.mX, this.mY));
roomUserByHabbo2.CanWalk = false;
roomUserByHabbo2.AllowOverride = false;
roomUserByHabbo2.UnlockWalking();
roomUserByHabbo2.TeleportEnabled = true;
roomUserByHabbo2.MoveTo(this.GetX, this.GetY, true);
roomUserByHabbo2.TeleportEnabled = false;
roomUserByHabbo2.UnlockWalking();
}
else
{
this.InteractingUser = 0u;
}
}
}
if (this.InteractingUser2 > 0u)
{
RoomUser roomUserByHabbo3 = this.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(this.InteractingUser2);
if (roomUserByHabbo3 != null)
{
flag3 = true;
roomUserByHabbo3.UnlockWalking();
roomUserByHabbo3.MoveTo(this.SquareInFront);
}
this.InteractingUser2 = 0u;
}
if (flag3)
{
if (this.ExtraData != "1")
{
this.ExtraData = "1";
this.UpdateState(false, true);
}
}
else
{
if (flag4)
{
if (this.ExtraData != "2")
{
this.ExtraData = "2";
this.UpdateState(false, true);
}
}
else
{
if (this.ExtraData != "0")
{
this.ExtraData = "0";
this.UpdateState(false, true);
}
}
}
this.ReqUpdate(1, false);
return;
}

4. Dê debug no projeto, salve e execute o emulador com essas modificações. 

xjoao xjoao  • 24.04.15 18:08

[Tutorial] Tirando bug do "tele" [Tutorial] Empty Re: [Tutorial] Tirando bug do "tele" [Tutorial] 24.04.15 18:08

ótimo tutorial irá ajudar muitos usuários

Saigon Saigon  • 24.04.15 18:29

[Tutorial] Tirando bug do "tele" [Tutorial] Empty Re: [Tutorial] Tirando bug do "tele" [Tutorial] 24.04.15 18:29

Obrigado por compartilhar, estarei fixando em breve.

Peeta Peeta  • 24.04.15 18:49

[Tutorial] Tirando bug do "tele" [Tutorial] Empty Re: [Tutorial] Tirando bug do "tele" [Tutorial] 24.04.15 18:49

Ótima iniciativa, já tinha visto esses códigos em outro lugar mas tinha os perdido.

Vong Vong  • 24.04.15 20:09

[Tutorial] Tirando bug do "tele" [Tutorial] Empty Re: [Tutorial] Tirando bug do "tele" [Tutorial] 24.04.15 20:09

Ótimo tutorial, Parabéns. 

PedroHB PedroHB  • 25.04.15 9:10

[Tutorial] Tirando bug do "tele" [Tutorial] Empty Re: [Tutorial] Tirando bug do "tele" [Tutorial] 25.04.15 9:10

Passa o open source já com esses códigos aí não acho nenhuma source que faça debug sem dar erros. ..
Permissões neste sub-fórum
Não podes responder a tópicos

BH Servers

Recomendamos a BH Servers com proteção DDOS gratuita em Cloud Server de alta performance. Entrega imediata.