summaryrefslogtreecommitdiff
path: root/src/pso/TProtocol.cpp
blob: b0be8ee7806917ffec5ee90c029abd630aaf51ae (plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#include <global_types.h>
#include <string.h>
#include "pso/forward.h"
#include "pso/macros.h"
#include "pso/TArray.h"
#include "pso/TMainTask.h"
#include "pso/TMenuList.h"
#include "pso/TPlyCharData.h"
#include "pso/TPlyDispData.h"
#include "pso/TPlyInventory.h"
#include "pso/TObject.h"
#include "pso/TProtocol.h"
#include "pso/TSocket.h"

OBJECT_NAME(TProtocol);

void TProtocol::run_task() {

}

int TProtocol::send(u8 *data, size_t size) {
	return TTcpSocket::send(data, size);
}

int handle_command(packet *pkt) {

}

TProtocol::~TProtocol() {

}

#define fill_with(name, value) memset(&m_##name, value, sizeof(m_##name))
#define copy(name) strncpy(m_##name.m_data, name, sizeof(m_##name.m_data))

#pragma dont_inline on
TProtocol::TProtocol(TObject *parent, u16 sub_version, int language, char *serial_number, char *access_key, char *password) : TTcpSocket(parent) {
	u8 thing[6];
	m_name = TProtocol_name;
	memset(thing, 0, sizeof(thing));
	{
		int i = 0;
		int j = 0;
		m_smth.m_smth.m_data[i++] = 0;
		m_smth.m_smth.m_data[i++] = 0;
		m_smth.m_smth.m_data[i++] = thing[j++];
		m_smth.m_smth.m_data[i++] = thing[j++];
		i = 0;
		m_smth.m_smth1.m_data[i++] = thing[j++];
		m_smth.m_smth1.m_data[i++] = thing[j++];
		m_smth.m_smth1.m_data[i++] = thing[j++];
		m_smth.m_smth1.m_data[i++] = thing[j++];
	}
	m_guildcard_tag = TPlyGuildCardTag(-1, -1);
	m_login_response_state = 0;
	m_connected = 0;
	m_joined_game = 0;
	m_has_meet_user_settings = 0;
	m_buffer_ready = 0;
	m_entry_count = 0;
	m_unused = 0;
	m_lobby_list_count = 0;
	m_unused5.m_data[0] = 0;
	m_unused2 = 0;
	m_udp_disabled = 0;
	m_packet_offset = 0;
	m_packet_size = 0;
	m_sub_version = sub_version;
	m_language = language;

	fill_with(serial_number, 0);
	fill_with(access_key, 0);
	fill_with(password, 0);

	copy(serial_number);
	copy(access_key);
	copy(password);

	fill_with(client_config, 0);

	m_recv_handlers.m_data[0] = nullptr;
	m_recv_handlers.m_data[1] = nullptr;
	m_recv_handlers.m_data[2] = nullptr;
	m_recv_handlers.m_data[3] = nullptr;
	m_recv_handlers.m_data[4] = nullptr;
	m_recv_handlers.m_data[6] = nullptr;
	m_recv_handlers.m_data[7] = nullptr;
	m_recv_handlers.m_data[8] = nullptr;
	m_recv_handlers.m_data[10] = nullptr;
	m_recv_handlers.m_data[11] = nullptr;
	m_recv_handlers.m_data[12] = nullptr;
	m_recv_handlers.m_data[13] = nullptr;
	m_recv_handlers.m_data[14] = nullptr;
	m_recv_handlers.m_data[36] = nullptr;
	m_recv_handlers.m_data[15] = nullptr;
	m_recv_handlers.m_data[16] = nullptr;
	m_recv_handlers.m_data[17] = nullptr;
	m_recv_handlers.m_data[18] = nullptr;
	m_recv_handlers.m_data[19] = nullptr;
	m_recv_handlers.m_data[20] = nullptr;
	m_recv_handlers.m_data[22] = nullptr;
	m_recv_handlers.m_data[23] = nullptr;
	m_recv_handlers.m_data[25] = nullptr;
	m_recv_handlers.m_data[26] = nullptr;
	m_recv_handlers.m_data[33] = nullptr;
	m_recv_handlers.m_data[34] = nullptr;
	m_recv_handlers.m_data[35] = nullptr;
	m_recv_handlers.m_data[36] = nullptr;
	m_recv_handlers.m_data[37] = nullptr;
	m_recv_handlers.m_data[38] = nullptr;
	m_recv_handlers.m_data[41] = nullptr;
	m_recv_handlers.m_data[28] = nullptr;
	m_recv_handlers.m_data[43] = nullptr;
	m_recv_handlers.m_data[42] = nullptr;
	m_recv_handlers.m_data[44] = nullptr;
	m_recv_handlers.m_data[45] = nullptr;
	m_recv_handlers.m_data[46] = nullptr;
	m_recv_handlers.m_data[49] = nullptr;
	m_recv_handlers.m_data[50] = nullptr;
	m_recv_handlers.m_data[51] = nullptr;
	m_recv_handlers.m_data[32] = nullptr;
	m_recv_handlers.m_data[47] = nullptr;
	m_recv_handlers.m_data[48] = nullptr;
}

void dummy();
#pragma dont_inline off
#undef fill_with
#undef copy