alorithm
alorithm
sizeof (struct sockaddr)
- __SOCKADDR_COMMON_SIZE
- sizeof (in_port_t)
- sizeof (struct in_addr)
\n
-1
.comm
, it sees value after =
in variable declaration, it generates instructions for it python
GameFlags = ["TEAMS", "FLAGS"]
0.7 game flags:
python
GameFlags = Flags("GAMEFLAG", ["TEAMS", "FLAGS", "SURVIVAL", "RACE"])
The 0.7 protocol extended the game flags without changing the old 0.6 flags. So flag teams and flag flags are th...2ce0a63
Update translations for 18.5, remove 0.7-only translations - def-
6db0cd8
Version 18.5 - def-
ad4b235
Run editor auto-reload on any local address, and not just localhost - furo321
4794776
add console chain for 0.7 tee - dobrykafe
a0741f1
Fix double free or corruption
crash with hot_reload
- furo321
4cfed35
Update Chinese translations - Pioooooogit submodule update
on fatal: Fetched in submodule path '../ddnet-libs', but it did not contain e78f350e7898fc6b0702cdc3b7ce6ee347c97d49. Direct fetching of that commit failed.
is this my unstable internet?Console()->Register("aboutme", "?i[times]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConAboutMe, this, "Show info about yourself");
after
Console()->Register("kill", "", CFGFLAG_CHAT | CFGFLAG_SERVER, ConProtectedKill, this, "Kill yourself when kill-protected during a long game (use f1, kill for regular kill)");
2. ddracechat.cpp
add
void CGameContext::ConAboutMe(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
if(!CheckClientId(pResult->m_ClientId))
return;
int Times = 1;
if(pResult->NumArguments() > 0)
Times = pResult->GetInteger(0);
if(Times < 1)
Times = 1;
const char *pName = pSelf->Server()->ClientName(pResult->m_ClientId);
int ClientVersion = pSelf->GetClientVersion(pResult->m_ClientId);
int Team = pSelf->GetDDRaceTeam(pResult->m_ClientId);
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientId];
// Check if it's null
if(!pPlayer)
{
dbg_msg("chat-about-me", "Player not found!");
return;
}
CCharacter *pChar = pPlayer->GetCharacter();
// Check if it's null
if(!pChar)
{
dbg_msg("chat-about-me", "Character not found! Player may be dead or spectating.");
return;
}
char aBuf[256];
str_format(aBuf, sizeof(aBuf),
"Name: %s | "
"ID: %d | "
"Version: %d | "
"Team: %d | "
"Current position: %f, %f",
pName,
pResult->m_ClientId,
ClientVersion,
Team,
pChar->m_Pos.x, pChar->m_Pos.y);
for(int i = 0; i < Times; i++)
{
pSelf->SendChatTarget(pResult->m_ClientId, aBuf);
}
}
after
void CGameContext::ConProtectedKill(IConsole::IResult *pResult, void *pUserData)
{
// codes
}
3. gamecontext.h
add
static void ConAboutMe(IConsole::IResult *pResult, void *pUserData);
after
static void ConProtectedKill(IConsole::IResult *pResult, void *pUserData);
(edited)2024-08-29 13:10:30 I chat: *** Name: MD | ID: 0 | Version: 18040 | Team: 0 | Current position: 396.000000, 2225.000000
Console()->Register("aboutme", "?i[times]", CFGFLAG_CHAT | CFGFLAG_SERVER, ConAboutMe, this, "Show info about yourself");
after
Console()->Register("kill", "", CFGFLAG_CHAT | CFGFLAG_SERVER, ConProtectedKill, this, "Kill yourself when kill-protected during a long game (use f1, kill for regular kill)");
2. ddracechat.cpp
add
void CGameContext::ConAboutMe(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
if(!CheckClientId(pResult->m_ClientId))
return;
int Times = 1;
if(pResult->NumArguments() > 0)
Times = pResult->GetInteger(0);
if(Times < 1)
Times = 1;
const char *pName = pSelf->Server()->ClientName(pResult->m_ClientId);
int ClientVersion = pSelf->GetClientVersion(pResult->m_ClientId);
int Team = pSelf->GetDDRaceTeam(pResult->m_ClientId);
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientId];
// Check if it's null
if(!pPlayer)
{
dbg_msg("chat-about-me", "Player not found!");
return;
}
CCharacter *pChar = pPlayer->GetCharacter();
// Check if it's null
if(!pChar)
{
dbg_msg("chat-about-me", "Character not found! Player may be dead or spectating.");
return;
}
char aBuf[256];
str_format(aBuf, sizeof(aBuf),
"Name: %s | "
"ID: %d | "
"Version: %d | "
"Team: %d | "
"Current position: %f, %f",
pName,
pResult->m_ClientId,
ClientVersion,
Team,
pChar->m_Pos.x, pChar->m_Pos.y);
for(int i = 0; i < Times; i++)
{
pSelf->SendChatTarget(pResult->m_ClientId, aBuf);
}
}
after
void CGameContext::ConProtectedKill(IConsole::IResult *pResult, void *pUserData)
{
// codes
}
3. gamecontext.h
add
static void ConAboutMe(IConsole::IResult *pResult, void *pUserData);
after
static void ConProtectedKill(IConsole::IResult *pResult, void *pUserData);
(edited)No such command: aboutme. Use /cmdlist for a list of all commands.
you probably write register part in wrong function check it againConProtectedKill
(edited)./DDNet-Server "exec my.cfg"
(edited)../skins/twinbop
and placing it as external works fine../countryflags/UA
doesnt2024-08-29 19:49:54 E game/png: failed to open file. filename='mapres/../countryflags/UA.png'
Show client IDs (scoreboard, chat, spectator)
storage.cpp
:
if(str_startswith(pFilename, "mapres/../skins/"))
{
pFilename = pFilename + 10; // just start from skins/
}
Show client IDs (scoreboard, chat, spectator)
foo.localhost
foo.localhost
Normal:
Team:
Dummy settings
Toggle to edit your dummy settings
Randomize
Are you sure that you want to delete '%s'?
Delete skin
Basic
Custom
Unable to delete skin
Customize
Normal:
Team:
Dummy settings
Toggle to edit your dummy settings
Randomize
Are you sure that you want to delete '%s'?
Delete skin
Basic
Custom
Unable to delete skin
Customize
Could not connect dummy
Dummy is not allowed on this server
Please wait…
are also related to this?Please wait…
is not in the button?