private void Realm_PacketLost(RealmServerPacket PacketID) { switch (PacketID) { case RealmServerPacket.CreateGameResponse: { this.Log.AddLine("Create Game Failed", Color.Red); this.FailToCreateGameEvent?.Invoke(); break; } case RealmServerPacket.JoinGameResponse: { this.Log.AddLine("Join Game Failed", Color.Red); this.FailToJoinGameEvent?.Invoke(); break; } } }
protected override void BattleNetToDiablo(byte[] data, ref PacketFlag flag) { byte[] packetData = new byte[data.Length - 2]; Buffer.BlockCopy(data, 2, packetData, 0, data.Length - 2); RealmServerPacket PacketID = (RealmServerPacket)packetData[0]; try { switch (PacketID) { //TODO: Add the rest of these... case RealmServerPacket.JoinGameResponse: OnJoinGameResponse(new RealmServer.JoinGameResponse(packetData), ref flag); break; } } catch (Exception ex) { Console.WriteLine(PacketID.ToString() + ": " + ex.Message); } }
public RSPacket(byte[] data) : base(data, Origin.RealmServer) { this.PacketID = (RealmServerPacket)data[0]; }
public RSPacket(byte[] data) : base(data, Origin.RealmServer) { this.PacketID = (RealmServerPacket) data[0]; }
public override void ParsePacket(byte[] Data) { DataReader dataReader = new DataReader(Data); int num = (int)dataReader.ReadInt16(); RealmServerPacket packetID = (RealmServerPacket)dataReader.ReadByte(); this.ReportPacket((int)packetID); switch (packetID) { case RealmServerPacket.RealmStartupResponse: { this.OnRealmStartupResponseEvent?.Invoke(new RealmStartupResponse(Data)); break; } case RealmServerPacket.CharacterCreationResponse: { this.OnCharacterCreationResponseEvent?.Invoke(new CharacterCreationResponse(Data)); break; } case RealmServerPacket.CreateGameResponse: { this.OnCreateGameResponseEvent?.Invoke(new CreateGameResponse(Data)); break; } case RealmServerPacket.JoinGameResponse: { this.OnJoinGameResponseEvent?.Invoke(new JoinGameResponse(Data)); break; } case RealmServerPacket.GameList: { this.OnGameListEvent?.Invoke(new GameList(Data)); break; } case RealmServerPacket.GameInfo: { this.OnGameInfoEvent?.Invoke(new GameInfo(Data)); break; } case RealmServerPacket.CharacterLogonResponse: { this.OnCharacterLogonResponseEvent?.Invoke(new CharacterLogonResponse(Data)); break; } case RealmServerPacket.CharacterDeletionResponse: { this.OnCharacterDeletionResponseEvent?.Invoke(new CharacterDeletionResponse(Data)); break; } case RealmServerPacket.MessageOfTheDay: { this.OnMessageOfTheDayEvent?.Invoke(new MessageOfTheDay(Data)); break; } case RealmServerPacket.GameCreationQueue: { this.OnGameCreationQueueEvent?.Invoke(new GameCreationQueue(Data)); break; } case RealmServerPacket.CharacterUpgradeResponse: { this.OnCharacterUpgradeResponseEvent?.Invoke(new CharacterUpgradeResponse(Data)); break; } case RealmServerPacket.CharacterList: { this.OnCharacterListEvent?.Invoke(new CharacterList(Data)); break; } } }