mirror of
https://github.com/Tiiffi/mcrcon.git
synced 2025-10-28 11:51:08 -04:00
Compare commits
2 Commits
bc5617407d
...
v0.7.3-dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d1c87b26f | |||
| fd77ad7fc0 |
6
mcrcon.c
6
mcrcon.c
@ -90,7 +90,7 @@ int run_terminal_mode(int sock);
|
|||||||
int run_commands(int argc, char *argv[]);
|
int run_commands(int argc, char *argv[]);
|
||||||
|
|
||||||
// Rcon protocol related functions
|
// Rcon protocol related functions
|
||||||
rc_packet* packet_build(int id, int cmd, char *s1);
|
rc_packet* packet_build(int id, int cmd, char s[static 1]);
|
||||||
void packet_print(rc_packet *packet);
|
void packet_print(rc_packet *packet);
|
||||||
bool rcon_auth(int sock, char *passwd);
|
bool rcon_auth(int sock, char *passwd);
|
||||||
int rcon_command(int sock, char *command);
|
int rcon_command(int sock, char *command);
|
||||||
@ -529,7 +529,7 @@ void packet_print(rc_packet *packet)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc_packet *packet_build(int id, int cmd, char *s)
|
rc_packet *packet_build(int id, int cmd, char s[static 1])
|
||||||
{
|
{
|
||||||
static rc_packet packet = {0};
|
static rc_packet packet = {0};
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ rc_packet *packet_build(int id, int cmd, char *s)
|
|||||||
packet.size = sizeof packet.id + sizeof packet.cmd + len + 2;
|
packet.size = sizeof packet.id + sizeof packet.cmd + len + 2;
|
||||||
packet.id = id;
|
packet.id = id;
|
||||||
packet.cmd = cmd;
|
packet.cmd = cmd;
|
||||||
memcpy(packet.data, s, len);
|
if (packet.size > 0) memcpy(packet.data, s, len);
|
||||||
packet.data[len] = 0;
|
packet.data[len] = 0;
|
||||||
packet.data[len + 1] = 0;
|
packet.data[len + 1] = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user