reduf / headquarter Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Compiling on Windows (can we get a label for this?)
Had a crash when subscribing/unsubscribing to an event via events_add_entry
and events_rem_entry
in events.c
, see below
void broadcast_event(EventManager *mgr, EventType e, void *args)
{
assert(0 <= e && e < N_EVENT);
CallbackEntry *entry;
struct list *it;
list_for_each(&mgr->callbacks[e], it) {
entry = list_entry(it, CallbackEntry, node);
assert(entry); // This should never happen if `events_rem_entry` is working correctly?
if (entry->callback) {
entry->callback(e, args, entry->param);
}
}
}
I've added the assertion here to flag it up; in theory entry
should never be a null pointer, is this correct? Otherwise we need
if (entry && entry->callback) {
entry->callback(e, args, entry->param);
}
To catch it, but this feels wrong too.
The offset of the message is wrong, because it was increased in a game update.
Heya I was wondering for which version of the game this tool is?
Because it seems pretty outdated, but already got the new DH Params, and created a new patcher for it (using probabilities), new packet handler (supports Lz4, and multi/split-packets), and got the packets extracted by modding the game, which hooks into the registration functions before the initialization.
We read the otp code as an integer and subsequently serialize it as an integer. This mean that if a code starts with 0(s), we loose the 0(s).
We could instead keep a string and simply forward user input.
In the following example, field.size
is 0. This is a problem when deserializing the structures.
Headquarter/code/client/network.c
Line 947 in 1fbe2ce
Headquarter/code/client/network.c
Line 1052 in 1fbe2ce
init_player(player);
needs to be called somewhere inside HandleAgentCreatePlayer
before copying the name from the packet
There was one instance of %S logging that was wrong here: https://github.com/reduf/Headquarter/blob/e200a554135235f2f72dca8e95837a18b653ef58/code/client/guild.c#L174L180
We have to be careful, because on Linux wchar_t
are usually 4 bytes and that would crash. Also, I'm not sure we can assume and I don't think we wants to assume the nul-termination here.
When compiling a plugin with client as a dependency, CMAKE_SOURCE_DIR
isn't the client source dir - use CMAKE_CURRENT_SOURCE_DIR
as per common and portal CMakeLists files
Change function definition from malloc
to calloc
to avoid uninitialised struct vars
static void ensure_agent_exist(GwClient *client, AgentId id)
{
ArrayAgent *agents = &client->world.agents;
if (array_inside(agents, id) && array_at(agents, id))
return;
if (!array_inside(agents, id)) {
array_resize(agents, id + 1);
agents->size = agents->capacity;
}
Agent *agent = calloc(1,sizeof(*agent));
agent->agent_id = id;
agent->speed_modifier = 1.f;
array_set(agents, id, agent);
}
The player array is bigger than the number of players, because the index are the player number. It's not necessarly a problem, but GetPlayers
is defined as:
ArrayPlayer players = client->world.players;
if (buffer == NULL) {
count = players.size;
goto leave;
}
So, we could keep track of the real number of players.
Probably an error in array_push
.
Seems to crash inside appendf
via portal login
appendf(&content, "<ConnType>400</ConnType>\n");
appendf(&content, "<Address>%s</Address>\n", sockname); // Segmentation fault here
No issues with windows
Assertion fails without it created
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.