forked from freadblangks/fake_players_patch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfake_players.patch
209 lines (198 loc) · 9.89 KB
/
fake_players.patch
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
From 92417f6667cfba73d8fbe658ba742cb452a6db2c Mon Sep 17 00:00:00 2001
From: milestorme <[email protected]>
Date: Tue, 1 Dec 2020 04:49:19 +1100
Subject: [PATCH] custom updates
---
src/server/game/Entities/Player/Player.cpp | 4 +++
src/server/game/Groups/GroupHandler.cpp | 9 ++++++
src/server/game/Guilds/Guild.cpp | 7 +++++
src/server/game/Handlers/ChatHandler.cpp | 9 ++++++
src/server/game/Handlers/MiscHandler.cpp | 34 ++++++++++++++++++++-
src/server/game/Miscellaneous/Language.h | 4 ++-
src/server/game/World/World.cpp | 1 +
src/server/game/World/World.h | 1 +
src/server/worldserver/oregoncore.conf.dist | 1 +
10 files changed, 70 insertions(+), 2 deletions(-)
--- /dev/null
+++ b/sql/LordPsyan-Patches/Fake_Players/world.fake_players.sql
@@ -0,0 +1,6 @@
+DELETE FROM `oregon_string` WHERE `entry` IN (10100, 10101, 10102);
+
+INSERT INTO `oregon_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) values
+('10100','Message: \"Do not disturb\".',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Сообщение: \"Не беспокоить\".'),
+('10101','Message: \"Player already in guild\".',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Сообщение: \"Не беспокоить\".'),
+('10102','Message: \"Player already in party\".',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Сообщение: \"Не беспокоить\".');
\ No newline at end of file
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index bed978f10..b49fd4756 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -1426,6 +1426,10 @@ void Player::Update(uint32 p_time)
// m_nextSave reset in SaveToDB call
SaveToDB();
sLog.outDetail("Player '%s' (GUID: %u) saved", GetName(), GetGUIDLow());
+ // If Fake WHO List system on then change player position with every SavePlayer Interval (usually 15min)
+ if (sWorld.getConfig(CONFIG_FAKE_WHO_LIST))
+ CharacterDatabase.PExecute("UPDATE characters_fake SET zone = (FLOOR(50 * RAND()) + 1) WHERE online>1");
+ CharacterDatabase.PExecute("UPDATE characters_fake SET level=level+1 WHERE online>1 AND level<5");
}
else
m_nextSave -= p_time;
diff --git a/src/server/game/Groups/GroupHandler.cpp b/src/server/game/Groups/GroupHandler.cpp
index 13044dd27..556c6554b 100644
--- a/src/server/game/Groups/GroupHandler.cpp
+++ b/src/server/game/Groups/GroupHandler.cpp
@@ -29,6 +29,7 @@
#include "MapManager.h"
#include "SocialMgr.h"
#include "Utilities/Util.h"
+#include "Language.h"
/* differeces from off:
-you can uninvite yourself - is is useful
@@ -76,8 +77,16 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recv_data)
// no player
if (!player)
{
+ if (sWorld.getConfig(CONFIG_FAKE_WHO_LIST))
+ {
+ sWorld.SendWorldText(LANG_NOT_INVITE_PARTY);
+ return;
+ }
+ else
+ {
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_CANT_FIND_TARGET);
return;
+}
}
// player trying to invite himself (most likely cheating)
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index af8fe9024..b79a761b8 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -143,7 +143,14 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
player = ObjectAccessor::Instance().FindPlayerByName(name.c_str());
if (!player)
{
+ // If Fake WHO List system on then show player DND
+ if (sWorld.getConfig(CONFIG_FAKE_WHO_LIST))
+ {
+ sWorld.SendWorldText(LANG_NOT_INVITE_GUILD);
+ return;
+ } else {
session->SendGuildCommandResult(GUILD_INVITE_S, name, ERR_GUILD_PLAYER_NOT_FOUND_S);
+ }
return;
}
diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp
index 5da5ff282..d5c87b113 100644
--- a/src/server/game/Handlers/ChatHandler.cpp
+++ b/src/server/game/Handlers/ChatHandler.cpp
@@ -292,8 +292,17 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data)
if (!player || (lang != LANG_ADDON && tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
{
+ // If Fake WHO List system on then show player DND
+ if (sWorld.getConfig(CONFIG_FAKE_WHO_LIST))
+ {
+ sWorld.SendWorldText(LANG_NOT_WHISPER);
+ return;
+ }
+ else
+ {
SendPlayerNotFoundNotice(to);
return;
+ }
}
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER)
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 9da72a6d7..5535b7853 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -384,7 +384,39 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recv_data)
++displaycount;
}
- data.put(0, displaycount); // insert right count, count of matches
+ if (sWorld.getConfig(CONFIG_FAKE_WHO_LIST) && displaycount < 49)
+ {
+ // Fake players on WHO LIST 0, 1, 2, 3, 4, 5
+ QueryResult* result = CharacterDatabase.Query("SELECT name,race,class,level,zone,gender FROM characters_fake WHERE online>1 AND level > 3");
+ if (result)
+ {
+ do
+ {
+ Field *fields = result->Fetch();
+
+ std::string pname = fields[0].GetString(); // player name
+ std::string gname; // guild name
+ uint32 lvl = fields[3].GetUInt32(); // player level
+ uint32 class_ = fields[2].GetUInt32(); // player class
+ uint32 race = fields[1].GetUInt32(); // player race
+ uint32 pzoneid = fields[4].GetUInt32(); // player zone id
+ uint8 gender = fields[5].GetUInt8(); // player gender
+
+ data << pname; // player name
+ data << gname; // guild name
+ data << uint32(lvl); // player level
+ data << uint32(class_); // player class
+ data << uint32(race); // player race
+ data << uint8(gender); // player gender
+ data << uint32(pzoneid); // player zone id
+
+ if ((++matchcount) == 49)
+ break;
+ } while (result->NextRow());
+ }
+ }
+
+ data.put(0, matchcount); // insert right count, count displayed
data.put(4, matchcount); // insert right count, count displayed
SendPacket(&data);
diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h
index 4ccf53513..71609ccb8 100644
--- a/src/server/game/Miscellaneous/Language.h
+++ b/src/server/game/Miscellaneous/Language.h
@@ -23,7 +23,9 @@ enum OregonStrings
// for chat commands
LANG_SELECT_CHAR_OR_CREATURE = 1,
LANG_SELECT_CREATURE = 2,
-
+ LANG_NOT_WHISPER = 10100,
+ LANG_NOT_INVITE_GUILD = 10101,
+ LANG_NOT_INVITE_PARTY = 10102,
// level 0 chat
LANG_SYSTEMMESSAGE = 3,
LANG_EVENTMESSAGE = 4,
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index d826383e2..2175840ff 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -655,6 +655,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig.GetBoolDefault("AllowTwoSide.WhoList", false);
m_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig.GetBoolDefault("AllowTwoSide.AddFriend", false);
m_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig.GetBoolDefault("AllowTwoSide.trade", false);
+ m_configs[CONFIG_FAKE_WHO_LIST] = sConfig.GetBoolDefault("Fake.WHO.List", true);
m_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfig.GetIntDefault("StrictPlayerNames", 0);
m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault("StrictCharterNames", 0);
m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault("StrictPetNames", 0);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index c6c808474..3550d3e6c 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -107,6 +107,7 @@ enum WorldConfigs
CONFIG_ALLOW_TWO_SIDE_WHO_LIST,
CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND,
CONFIG_ALLOW_TWO_SIDE_TRADE,
+ CONFIG_FAKE_WHO_LIST,
CONFIG_STRICT_PLAYER_NAMES,
CONFIG_UINT32_ASYNC_QUERIES_TICK_TIMEOUT,
CONFIG_STRICT_CHARTER_NAMES,
diff --git a/src/server/worldserver/oregoncore.conf.dist b/src/server/worldserver/oregoncore.conf.dist
index 87ca663f8..e1e6303be 100644
--- a/src/server/worldserver/oregoncore.conf.dist
+++ b/src/server/worldserver/oregoncore.conf.dist
@@ -922,6 +922,7 @@ AllowTwoSide.Interaction.Mail = 0
AllowTwoSide.WhoList = 0
AllowTwoSide.AddFriend = 0
AllowTwoSide.Trade = 0
+Fake.WHO.List = 1
TalentsInspecting = 1
###############################################################################