-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PacketFactory.h
47 lines (47 loc) · 2.21 KB
/
PacketFactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include "Packets/Packet.h"
#include "Packets/PrSyncTick.h"
#include "Packets/PrSyncDate.h"
#include "Packets/PrLogin.h"
#include "Packets/PrWorldList.h"
#include "Packets/PrWorldSelect.h"
#include "Packets/PrAuthLogin.h"
#include "Packets/PrChaList.h"
#include "Packets/PrUserPin2Check.h"
#include "Packets/PrChaCreate.h"
class PacketFactory {
public:
static Packet* GetServerPacket(unsigned int rttiValue) {
Packet* packet = nullptr;
switch (rttiValue) {
case 0x764F67D9: //PqSyncTick
packet = new PrSyncTick();
break;
case 0x6C388FD7: //PqSyncDate
packet = new PrSyncDate();
break;
case 0x40C38368: //PqLogin
packet = new PrLogin();
break;
case 0xfd1640f: //PqWorldList
packet = new PrWorldList();
break;
case 0x3B97F44D:
packet = new PrWorldSelect();
break;
case 0xEE91300:
packet = new PrAuthLogin();
break;
case 0x42DC33B9:
packet = new PrChaList();
break;
case 0x1DA13B1F:
packet = new PrUserPin2Check();
break;
case 0x14855EF7:
packet = new PrChaCreate();
break;
}
return packet;
}
};