1 (edited by nozimc159 2016-10-14 18:48:21)

Topic: 'Server Dummy'

I say how adding dummy for server
Yees add

"gamecontext.h" Public add
int CreatedDummys;

"player.h" Public add
bool m_IsDummy;

void CGameContext::CreateNewDummy()
    m_apPlayers[7 + CreatedDummys] = new(7 + CreatedDummys) CPlayer(this, 7 + CreatedDummys, TEAM_RED);
    m_apPlayers[7 + CreatedDummys]->TryRespawn();

    m_apPlayers[7 + CreatedDummys]->m_IsDummy = true; 
    m_apPlayers[7 + CreatedDummys]->m_TeeInfos.m_UseCustomColor = false;

    m_pController->OnPlayerInfoChange(m_apPlayers[7 + CreatedDummys]);

void CServer::DummyHelper(int BotNum)
    const char *pNames[] = {
    const char *pClans[] = {
    str_copy(m_aClients[BotNum + 7].m_aName, pNames[BotNum], MAX_NAME_LENGTH);
    str_copy(m_aClients[BotNum + 7].m_aClan, pClans[BotNum], MAX_CLAN_LENGTH);
    m_aClients[BotNum + 7].m_State = CClient::STATE_INGAME;

okey, go add command go
if(!str_comp(pMsg->m_pMessage, "/dummy"))

and "server.cpp"
g_Config.m_SvMaxClients = 8;


Re: 'Server Dummy'

You should maybe state from where you got this, since you aren't the author of all that.

I'll quickly do that for you... http://teeworlds-friends.de/Forum/index … tID=172171


Re: 'Server Dummy'

Yea, that is some really old code I wrote? What's the issue with it?

Real programmers don't comment their code - it was hard to write, it should be hard to understand.
Proudly verkeckt since 2010.


Re: 'Server Dummy'

I have something relevant to this thread as well:
Stable dummies by Pikotee:
https://github.com/Shahan/teeworlds/com … bc77668bdd
And one more commit: https://github.com/Shahan/teeworlds/com … ddf967ac91


Re: 'Server Dummy'

Error compiling can help me?
skype: lololoshara.her