protected override void HandleAppPacket(AppPacket packet) { Hexdump(packet.Data); switch ((LoginOp)packet.Opcode) { case LoginOp.ChatMessage: Send(AppPacket.Create(LoginOp.Login, new Login(), cryptoBlob)); break; case LoginOp.LoginAccepted: if (packet.Data.Length < 80) { LoginSuccess?.Invoke(this, false); } else { var dec = Decrypt(packet.Data, 10); var rep = new LoginReply(dec); accountID = rep.AcctID; sessionKey = rep.Key; LoginSuccess?.Invoke(this, true); } break; case LoginOp.ServerListResponse: var header = packet.Get <ServerListHeader>(); ServerList?.Invoke(this, header.Servers); break; case LoginOp.PlayEverquestResponse: var resp = packet.Get <PlayResponse>(); if (!resp.Allowed) { UnityEngine.Debug.LogError("Response flagged Allowed false"); curPlay = null; } PlaySuccess?.Invoke(this, curPlay); break; default: UnityEngine.Debug.Log($"Unhandled packet in LoginStream: {(LoginOp) packet.Opcode} (0x{packet.Opcode:X04})"); Hexdump(packet.Data); break; } }
protected override void HandleAppPacket(AppPacket packet) { switch ((WorldOp)packet.Opcode) { case WorldOp.GuildsList: break; case WorldOp.LogServer: case WorldOp.ApproveWorld: case WorldOp.EnterWorld: case WorldOp.ExpansionInfo: break; case WorldOp.SendCharInfo: var chars = new CharacterSelect(packet.Data); CharacterList?.Invoke(this, chars.Characters); break; case WorldOp.MessageOfTheDay: MOTD?.Invoke(this, Encoding.ASCII.GetString(packet.Data)); break; case WorldOp.ZoneServerInfo: var info = packet.Get <ZoneServerInfo>(); ZoneServer?.Invoke(this, info); break; default: WriteLine($"Unhandled packet in WorldStream: {(WorldOp)packet.Opcode} (0x{packet.Opcode:X04})"); Hexdump(packet.Data); break; } }
protected override void HandleAppPacket(AppPacket packet) { switch ((WorldOp)packet.Opcode) { case WorldOp.GuildsList: break; case WorldOp.LogServer: case WorldOp.ApproveWorld: case WorldOp.EnterWorld: case WorldOp.ExpansionInfo: break; case WorldOp.SendCharInfo: var chars = new CharacterSelect(packet.Data); CharacterList?.Invoke(this, chars.Characters); break; case WorldOp.MessageOfTheDay: MOTD?.Invoke(this, Encoding.ASCII.GetString(packet.Data)); break; case WorldOp.ZoneServerInfo: var info = packet.Get <ZoneServerInfo>(); ZoneServer?.Invoke(this, info); break; case WorldOp.SetChatServer: case WorldOp.SetChatServer2: ChatServerList?.Invoke(this, packet.Data); break; case WorldOp.PostEnterWorld: // The emu doesn't do anything with ApproveWorld and WorldClientReady so we may be able to just skip them both. Send(AppPacket.Create(WorldOp.ApproveWorld, null)); Send(AppPacket.Create(WorldOp.WorldClientReady, null)); break; case WorldOp.ApproveName: CharacterCreateNameApproval?.Invoke(this, packet.Data[0]); break; default: WriteLine($"Unhandled packet in WorldStream: {(WorldOp)packet.Opcode} (0x{packet.Opcode:X04})"); Hexdump(packet.Data); break; } }
protected override void HandleAppPacket(AppPacket packet) { switch ((ZoneOp)packet.Opcode) { case ZoneOp.PlayerProfile: var player = packet.Get <PlayerProfile>(); //WriteLine(player); break; case ZoneOp.CharInventory: var inventory = packet.Get <CharInventory>(); //WriteLine(inventory); break; case ZoneOp.TimeOfDay: var timeofday = packet.Get <TimeOfDay>(); //WriteLine(timeofday); break; case ZoneOp.TaskActivity: var activity = packet.Get <TaskActivity>(); //WriteLine(activity); break; case ZoneOp.TaskDescription: var desc = packet.Get <TaskDescription>(); //WriteLine(desc); break; case ZoneOp.CompletedTasks: var comp = packet.Get <CompletedTasks>(); //WriteLine(comp); break; case ZoneOp.XTargetResponse: var xt = packet.Get <XTarget>(); //WriteLine(xt); break; case ZoneOp.Weather: var weather = packet.Get <Weather>(); //WriteLine(weather); if (entering) { Send(AppPacket.Create(ZoneOp.ReqNewZone)); } break; case ZoneOp.TributeTimer: var timer = packet.Get <TributeTimer>(); //WriteLine(timer); break; case ZoneOp.TributeUpdate: var update = packet.Get <TributeInfo>(); //WriteLine(update); break; case ZoneOp.ZoneEntry: var mob = packet.Get <Spawn>(); //WriteLine(mob); break; case ZoneOp.NewZone: Send(AppPacket.Create(ZoneOp.ReqClientSpawn)); break; case ZoneOp.SendExpZonein: if (packet.Data.Length == 0) { Send(AppPacket.Create(ZoneOp.ClientReady)); entering = false; } break; case ZoneOp.SendFindableNPCs: var npc = packet.Get <FindableNPC>(); //WriteLine(npc); break; case ZoneOp.ClientUpdate: break; case ZoneOp.HPUpdate: break; default: WriteLine($"Unhandled packet in ZoneStream: {(ZoneOp) packet.Opcode} (0x{packet.Opcode:X04})"); Hexdump(packet.Data); break; } }
protected override void HandleAppPacket(AppPacket packet) { try { // UnityEngine.Debug.Log($"Got packet { (ZoneOp)packet.Opcode} (0x{ packet.Opcode:X04}"); switch ((ZoneOp)packet.Opcode) { case ZoneOp.PlayerProfile: var player = packet.Get <PlayerProfile>(); UnityEngine.Debug.Log("Profile:" + player); break; case ZoneOp.CharInventory: // var inventory = packet.Get<CharInventory>(); // UnityEngine.Debug.Log("Inventory: "+inventory); break; case ZoneOp.TimeOfDay: // var timeofday = packet.Get<TimeOfDay>(); // UnityEngine.Debug.Log(timeofday); break; case ZoneOp.TaskActivity: // var activity = packet.Get<TaskActivity>(); // UnityEngine.Debug.Log(activity); break; case ZoneOp.TaskDescription: // var desc = packet.Get<TaskDescription>(); // UnityEngine.Debug.Log(desc); break; case ZoneOp.CompletedTasks: // var comp = packet.Get<CompletedTasks>(); // UnityEngine.Debug.Log(comp); break; case ZoneOp.XTargetResponse: // var xt = packet.Get<XTarget>(); // UnityEngine.Debug.Log(xt); break; case ZoneOp.Weather: // var weather = packet.Get<Weather>(); // UnityEngine.Debug.Log(weather); if (entering) { Send(AppPacket.Create(ZoneOp.ReqNewZone)); } break; case ZoneOp.TributeTimer: //var timer = packet.Get<TributeTimer>(); // UnityEngine.Debug.Log(timer); break; case ZoneOp.TributeUpdate: // var update = packet.Get<TributeInfo>(); // UnityEngine.Debug.Log(update); break; case ZoneOp.ZoneEntry: var mob = packet.Get <Spawn>(); ZoneEntry.Invoke(this, mob); //UnityEngine.Debug.Log(mob); break; case ZoneOp.NewZone: Send(AppPacket.Create(ZoneOp.ReqClientSpawn)); break; case ZoneOp.SendExpZonein: if (packet.Data.Length == 0) { Send(AppPacket.Create(ZoneOp.ClientReady)); entering = false; } break; case ZoneOp.SendFindableNPCs: // var npc = packet.Get<FindableNPC>(); // UnityEngine.Debug.Log(npc); break; case ZoneOp.ClientUpdate: UnityEngine.Debug.Log("Sending Client Update"); //PlayerPositionUpdateServer.Invoke(this, packet.Get<PlayerPositionUpdateServer>()); break; case ZoneOp.SpawnAppearance: break; case ZoneOp.Stamina: break; case ZoneOp.SpecialMesg: break; case ZoneOp.Death: break; case ZoneOp.DeleteSpawn: DeleteSpawn.Invoke(this, packet.Get <DeleteSpawn>()); break; case ZoneOp.PlayerStateAdd: break; case ZoneOp.PlayerStateRemove: break; case ZoneOp.ChannelMessage: UnityEngine.Debug.Log("Got channel message"); ChannelMessage.Invoke(this, packet.Get <ChannelMessage>()); break; case ZoneOp.HPUpdate: SpawnHPUpdate.Invoke(this, packet.Get <SpawnHPUpdate>()); break; case ZoneOp.ManaUpdate: break; case ZoneOp.EnduranceUpdate: break; case ZoneOp.SpawnPositionUpdate: SpawnPositionUpdate.Invoke(this, packet.Get <SpawnPositionUpdate>()); break; case ZoneOp.BuffCreate: break; case ZoneOp.AltCurrency: break; case ZoneOp.WearChange: break; case ZoneOp.GuildMOTD: break; case ZoneOp.RaidUpdate: break; case ZoneOp.ExpUpdate: break; case ZoneOp.WorldObjectsSent: break; case 0x0: //This is a catch for an empty OP that happens.. dunno break; case ZoneOp.SendAAStats: break; case ZoneOp.SendZonepoints: break; case ZoneOp.GroundSpawn: break; case ZoneOp.SpawnDoor: break; default: UnityEngine.Debug.Log($"Unhandled packet in ZoneStream: {(ZoneOp) packet.Opcode} (0x{packet.Opcode:X04})"); Hexdump(packet.Data); break; } } catch (Exception e) { UnityEngine.Debug.LogError($"Failed to process {(ZoneOp) packet.Opcode} (0x{packet.Opcode:X04}):" + e.Message); } }
protected override void HandleAppPacket(AppPacket packet) { //WriteLine($"Zone app packet: {(ZoneOp) packet.Opcode}"); switch ((ZoneOp)packet.Opcode) { case ZoneOp.PlayerProfile: var player = packet.Get <PlayerProfile>(); //WriteLine(player); break; case ZoneOp.TimeOfDay: var timeofday = packet.Get <TimeOfDay>(); //WriteLine(timeofday); break; case ZoneOp.TaskActivity: // XXX: Handle short activities! //var activity = packet.Get<TaskActivity>(); //WriteLine(activity); break; case ZoneOp.TaskDescription: var desc = packet.Get <TaskDescription>(); //WriteLine(desc); break; case ZoneOp.CompletedTasks: var comp = packet.Get <CompletedTasks>(); //WriteLine(comp); break; case ZoneOp.XTargetResponse: var xt = packet.Get <XTarget>(); //WriteLine(xt); break; case ZoneOp.Weather: var weather = packet.Get <Weather>(); //WriteLine(weather); if (entering) { Send(AppPacket.Create(ZoneOp.ReqNewZone)); } break; case ZoneOp.TributeTimer: var timer = packet.Get <TributeTimer>(); //WriteLine(timer); break; case ZoneOp.TributeUpdate: var update = packet.Get <TributeInfo>(); //WriteLine(update); break; case ZoneOp.ZoneEntry: var mob = packet.Get <Spawn>(); if (mob.Name == charName) { playerSpawnId = (ushort)mob.SpawnID; } Spawned(this, mob); break; case ZoneOp.NewZone: Send(AppPacket.Create(ZoneOp.ReqClientSpawn)); break; case ZoneOp.SendExpZonein: if (entering) { Send(AppPacket.Create(ZoneOp.ClientReady)); entering = false; } break; case ZoneOp.CharInventory: break; case ZoneOp.SendFindableNPCs: var npc = packet.Get <FindableNPC>(); //WriteLine(npc); break; case ZoneOp.ClientUpdate: var pu = packet.Get <PlayerPositionUpdate>(); PositionUpdated?.Invoke(this, pu); break; case ZoneOp.HPUpdate: break; default: //WriteLine($"Unhandled packet in ZoneStream: {(ZoneOp) packet.Opcode} (0x{packet.Opcode:X04})"); //Hexdump(packet.Data); break; } }