Giter Site home page Giter Site logo

rehlds's People

Contributors

a1batross avatar adidasman1 avatar afwn90cj93201nixr2e1re avatar amaroq7 avatar anzz1 avatar bryant1410 avatar chuvi-w avatar dreamstalker avatar etojuice avatar francoromaniello avatar garey27 avatar ignaciofdm avatar in-line avatar jonatan1024 avatar justgo97 avatar levshisterov avatar namazso avatar nord1cwarr1or avatar raulitop avatar s1lentq avatar sh1ft0x0ef avatar souvikdas95 avatar spark512 avatar stevenkal avatar theasmodai avatar thecrock avatar urufusan avatar walkza avatar wopox1337 avatar wpmgprostotema avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rehlds's Issues

Amxmodx func_buyzone EngFunc_RemoveEntity problem and csdm_remove_weaponbox func. on last build

Hello,
We have problem rehlds-0.2-20150707.203020-55 bugfixed version.

I was try to using CSDM mod with reHLDS server will crash on remove func_buyzone entities.
no problem func_hostage_rescue or info_hostage_rescue just func_buyzone

CSDM mod works perfect rehlds-0.2-20150705.202431-54 bugfixed version

if ((g_MapStripFlags & MAPSTRIP_HOSTAGE) /* && (containi(mapname, "cs_") != -1) */)
{
        RemoveEntityAll("func_hostage_rescue")
        RemoveEntityAll("info_hostage_rescue")
}

if (g_MapStripFlags & MAPSTRIP_BUY)
{
        RemoveEntityAll("func_buyzone") 
}
...
stock RemoveEntityAll(name[])
{

    new ent = engfunc(EngFunc_FindEntityByString, 0, "classname", name)
    new temp
    while (ent)
    {
        temp = engfunc(EngFunc_FindEntityByString, ent, "classname", name)
        engfunc(EngFunc_RemoveEntity, ent) //crashed here
        ent = temp
    }
}

and i have got a problem csdm_remove_weaponbox function.

run_drop_wbox(id, ent, shield)
{
    new ret
    new model[32]
    ExecuteForward(g_drop_fwd, ret, id, ent, 0)
    if (ret == CSDM_DROP_REMOVE)
    {
        if (shield)
            csdm_remove_weaponbox(id, ent, 0, 1, 1)
        else
            csdm_remove_weaponbox(id, ent, 0, 1, 0)
        return 1
    } 
    else if (ret == CSDM_DROP_IGNORE) 
    {
        return 0
    }
    if (g_StayTime > 20 || g_StayTime < 0)
    {
        return 0
    }
    if (ent)
    {
        pev(ent, pev_model, model, 31)
        if (((equali(model,"models/w_usp.mdl")) || (equali(model,"models/w_glock18.mdl")))
                && (g_StripWeapons))
            csdm_remove_weaponbox(id, ent, 0, 0, 0) //boom crash when player drop usp or glock

        else if ((equali(model,"models/w_backpack.mdl")) && (g_RemoveBomb))
            csdm_remove_weaponbox(id, ent, 0, 0, 0)
        else if (shield)
            csdm_remove_weaponbox(id, ent, g_StayTime, 1, 1)
        else
            csdm_remove_weaponbox(id, ent, g_StayTime, 1, 0)
        return 1
    }
    return 0
}
static cell AMX_NATIVE_CALL csdm_remove_weaponbox(AMX *amx, cell *params)
{
    // Check index.
    unsigned int owner = params[1];
    unsigned int ent = params[2];
    const unsigned char m_rgpPlayerItems_wpnbx[] = { 34, 35, 36, 37, 38, 39 };

    if (owner < 1 || owner > (unsigned int)gpGlobals->maxClients)
    {
        MF_LogError(amx, AMX_ERR_NATIVE, "Invalid player %d", owner);
        return 0;
    } else if (!MF_IsPlayerIngame(owner)) {
        MF_LogError(amx, AMX_ERR_NATIVE, "Player %d is not in game", owner);
        return 0;
    }

    unsigned int weapon_shield = params[5];
    edict_t *searchEnt = INDEXENT(ent);

    if (FNullEnt(searchEnt))
    {
        MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weaponbox %d", ent);
        return 0;
    } else if ((weapon_shield != 1) && (strcmp(STRING(searchEnt->v.classname),"weaponbox") != 0)) {
        MF_LogError(amx, AMX_ERR_NATIVE, "Not a weaponbox %d", ent);
        return 0;
    } else if ((weapon_shield == 1) && (strcmp(STRING(searchEnt->v.classname),"weapon_shield") != 0)) {
        MF_LogError(amx, AMX_ERR_NATIVE, "Not a shield %d", ent);
        return 0;
    }

    edict_t *pEdict = MF_GetPlayerEdict(owner);
    if (weapon_shield == 1)
    {
        if (searchEnt->v.owner == pEdict)
        {
            if (!params[3])
            {
                if (NotifyForRemove(owner, searchEnt, NULL))
                {
                    REMOVE_ENTITY(searchEnt);
                }
            } else {
                RemoveWeapon::SchedRemoval(params[3], pEdict, NULL, searchEnt);
            }
            return 1;
        }
        MF_LogError(amx, AMX_ERR_NATIVE, "Shield %d not found", ent);
        return 0;
    }

    edict_t *pWeapEdict;
    unsigned char i;

    for( i = 0; i < sizeof (m_rgpPlayerItems_wpnbx); i++ )
    {
        pWeapEdict = get_pdata_cbase( searchEnt, m_rgpPlayerItems_wpnbx[ i ] + EXTRAOFFSET_WEAPONS );

        if (pWeapEdict == NULL)
            continue;
        if (FNullEnt(pWeapEdict))
            continue;
        if (pWeapEdict->free)
            continue;
        if ((pWeapEdict->v.flags & FL_FAKECLIENT) || (pWeapEdict->v.flags & FL_CLIENT))
            continue;
        if (pWeapEdict->v.owner == searchEnt)
        {
//          ALERT(at_logged, "CSDM - found weapon edict in private data of weaponbox in slot %d.\n", i);
            if (!params[3] || !params[4])
            {
                if (NotifyForRemove(owner, pWeapEdict, searchEnt))
                {
                    REMOVE_ENTITY(pWeapEdict);
                    REMOVE_ENTITY(searchEnt);
                }
            }
            else 
            {
                FindWeapon *p = FindWeapon::NewFindWeapon(pEdict, STRING(pWeapEdict->v.classname), params[3]);
                g_Timer.AddTask(p, 0.1);
                return 1;

//              RemoveWeapon::SchedRemoval(params[3], pEdict, searchEnt, pWeapEdict);
            }
            return 1;
        }
    }
    ALERT(at_logged, "CSDM - weapon edict not found in private data of weaponbox!!!.\n");
    return 0;
}

Banned for move commands flooding (burst)

Hi. I tried to install rehlds on several servers on fastcup.net, but servers are banned some players with reason "Banned for move commands flooding (burst)"

Current settings:
sv_maxupdaterate 102
sv_minupdaterate 102
sv_maxrate 100000
sv_minrate 100000
sys_ticrate 1060

Rehlds build: 563

Bits writing MSG_ functions may write data outside allocated buffer when sizebuf_t is overflowed

Bits writing MSG_ functions (MSG_WriteBits, MSG_WriteOneBit) are designed in a way that the byte being currently written lays outside of cursize of sizebuf on which bits writing is performed.
This could be clearly seen in MSG_StartBitWriting's code

    bfwrite.nCurOutputBit = 0;
    bfwrite.pbuf = buf;
    bfwrite.pOutByte = &buf->data[buf->cursize]; // <<<<=========

Here we set the bfwrite.pOutByte to a pointer in the buf->data buffer that lays outside buf->curside, and, possibly, may even lay outside allocated buf->data buffer (when cursize == maxsize). Notice that SZ_GetSpace() is not called here, so SIZEBUF_OVERFLOWED flag will not be set.

If we then call MSG_WriteOneBit(), data will be written into bfwrite.pOutByte pointer, without calling SZ_GetSpace(). In that case 1 byte after the allocated buf->data buffer will be corrupted.

Another piece of crappy code is hiding inside MSG_WriteBits:

    int surplusBytes = 0;
    if ((uint32)bfwrite.nCurOutputBit >= 8) {
        surplusBytes = 1; //surplusBytes could be either 0 or 1
        ....
    }
    ....
        SZ_GetSpace(bfwrite.pbuf, surplusBytes + 4); //allocate 4 or 5 bytes
        if (!(bfwrite.pbuf->flags & SIZEBUF_OVERFLOWED))
        {
            // write 4 bytes (it's ok)
            *(uint32 *)bfwrite.pOutByte = (data << bfwrite.nCurOutputBit) | *(uint32 *)bfwrite.pOutByte & ROWBITTABLE[bfwrite.nCurOutputBit];
            int leftBits = 32 - bfwrite.nCurOutputBit;
            bfwrite.nCurOutputBit = bits & 7;
            bfwrite.pOutByte += 4;
            *(uint32 *)bfwrite.pOutByte = data >> leftBits; //then write another 4 bytes! wtf?
        }

Here (in some rare cases) we allocate 4 or 5 bytes are from sizebuf and then write 8 bytes there. If sizebuf's data is the last variable allocated on stack and -fomit-frame-pointers is used, the whole return address will be rewritten and hlds will experience a (not) funny trip into nowhere when it executes the ret instruction, he-he.

Decal_Init func reads incorrect decals.wad - ignores mod

Hi
It seems that rehlds looks for decals.wad in DEFAULTGAME instead of GAME folder.
In other words it ignores MOD settings (-game modname).

How to replicate:

  1. run PROCMON.EXE from Sysinternals tools to monitor which decals.wad is read.
  2. filter to "Process" is "hlds.exe" and "Path" contains "decals.wad",
  3. rename valve\decals.wad
  4. run hlds.exe - game gearbox .. or any other mod.
  5. HLDS crashes with "Couldn't find DECALS.WAD in DEFAULTGAME"
  6. Procmon reveals that hlds looks for the file only in VALVE and VALVE_HD folders. It ignores mod settings.

void Decal_Init(void)

Plz fix mod detection.

Simple anti-cheat logic

It's just a question/request.. so

Can we have a simple code implemented to break current cheats? something like to stop sending unwanted data to clients (non-visible enemies position for e.g). This feature will get you some real popular usage besides stability and improvement.

anyway, thank you guys.

Error Windows XP SP 3

Hello.
These errors appear after replacing the file swds.dll folder "bugfixed" and "pure".

An error occurred when the server starts:
"The procedure entry point K32GetModuleInformation not be located in the dynamic link library KERNEL32.dll"

Configuration OS:
Windows XP SP 3

Function Host_Kick_f is not working correctly

2016-01-25_00002
Oke. I'll kick myself on userid
2016-01-25_00003
But i am still on the server, was not kicked
And now let's write
2016-01-25_00004
And it's working
2016-01-25_00005
Please, fix "kick 'userid'" cmd, this cmd absolutely not working. "kick 'name'" cmd is working nice

SZ_GetSpace: overflow on

http://prntscr.com/aaygy2
проблема носит массовый характер, так что я думаю разработчикам стоит обратить на это внимание. Игроки жалуются каждый день, что тупо виснет все и кикает по таймауту.

sys_ticrate > 1000

Why rehlds not supports server fps > 1000?
When i set sys_ticrate to 1060 (for example), in stats fps still < 1000 (unstable, 850-990)

Intel Xeon E5-1620 v2, Ubuntu 14.04 with kernel 4.1.0-rt10 (realtime, 1000hz).

HLSDK NEWAPI function pfnShouldCollide doesn't work properly

This bug was discovered by hzqst https://forums.alliedmods.net/member.php?u=39607

When gamedll returns false in pfnShouldCollide (entities shouldn't collide), engine ignores collisions with all subsequent entities. This can lead to bugs in physics. The bug occurs because of a premature return from SV_ClipToLinks https://github.com/dreamstalker/rehlds/blob/master/rehlds/engine/world.cpp#L1196

        if (gNewDLLFunctions.pfnShouldCollide && !gNewDLLFunctions.pfnShouldCollide(touch, clip->passedict))
            return;

It would be correct to continue the loop instead of return.

compiling error

I got a few erros

[root@localhost
rehlds]# ./gradlew --max-workers=1 clean buildRelease
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
:dep/bzip2:clean
:dep/cppunitlite:clean UP-TO-DATE
:flightrec/decoder:clean UP-TO-DATE
:flightrec/decoder_api:clean UP-TO-DATE
:rehlds:clean
:dep/bzip2:compileReleaseBzip2StaticLibraryBzip2Bz2_main
:dep/bzip2:compileReleaseBzip2StaticLibraryBzip2Bz2_pch
:dep/bzip2:createReleaseBzip2StaticLibrary
:dep/bzip2:releaseBzip2StaticLibrary
:rehlds:generateAppVersion
:rehlds:compileReleaseRehldsFixesRehlds_swds_engineSharedLibraryRehlds_swds_engineRehlds_pch
In file included from /home/genki/rehlds/rehlds/rehlds/public/rehlds/osconfig.h(92),
from /home/genki/rehlds/rehlds/rehlds/rehlds/precompiled.h(5),
from /home/genki/rehlds/rehlds/rehlds/rehlds/precompiled.cpp(1):
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/smmintrin.h(32): error: #error directive: "SSE4.1 instruction set not enabled"

error "SSE4.1 instruction set not enabled"

^

compilation aborted for /home/genki/rehlds/rehlds/rehlds/rehlds/precompiled.cpp (code 2)
:rehlds:compileReleaseRehldsFixesRehlds_swds_engineSharedLibraryRehlds_swds_engineRehlds_pch FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':rehlds:compileReleaseRehldsFixesRehlds_swds_engineSharedLibraryRehlds_swds_engineRehlds_pch'.
    A build operation failed.
    C++ compiler failed while compiling precompiled.cpp.
    See the complete log at: file:///home/genki/rehlds/rehlds/rehlds/build/tmp/compileReleaseRehldsFixesRehlds_swds_engineSharedLibraryRehlds_swds_engineRehlds_pch/output.txt
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    BUILD FAILED
    Total time: 18.264 secs

[root@localhost rehlds]# cat /etc/release
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)
CentOS release 6.7 (Final)

[root@localhost rehlds]# uname -a
Linux localhost.localdomain 2.6.32.71 #2 SMP Wed Mar 23 01:01:07 EET 2016 x86_64 x86_64 x86_64 GNU/Linux

[root@localhost rehlds]# uname -r
2.6.32.71

smmintrin.h 31-33 lines

ifndef SSE4_1

#error "SSE4.1 instruction set not enabled"

else

Cpu information

[root@localhost rehlds]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU X5660 @ 2.80GHz
stepping : 2
cpu MHz : 2792.990
cache size : 12288 KB
physical id : 1
siblings : 12
core id : 0
cpu cores : 6
apicid : 32
initial apicid : 32
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips : 5585.98
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

Make ReHlds SDK compatible with original HLSDK

During reverse engineering some changes were made in SDK that now break compatibility with original hlsdk. These changes include:

  • Use of osconfig.h which is rehlds-specific
  • Use of types like uint32_t which are not defined in original sdk
  • Use of "precompiled.h" header in public .cpp files

The task is to refactor both sdk and rehlds to make rehlds sdk compatible with original hlsdk.

Definition of done: Amxmodx is successfully compiled with rehlds sdk

Longjump not working (bugged) when using CTF powerup (item_ctflongjump)

Hi
I've been testing rehlds thoroughly on Opposing Force. There are basically two options how to get long jump - by grabbing the well known item_longjump or by taking powerup item_ctflongjump (it can be dropped)

I noticed that long jump works correctly for the default item_longjump, but is bugged for item_ctflongjump (your jump stops midair like if you hit invisible wall).

Maybe it's related to the following bool value:

BOOL m_fLongJump; // does this player have the longjump module?

Plz fix it guys.

I'm running a password protected server with bugfixed version (rehlds-0.2-20160128.133207-120).
Run the following commands in opfor console to connect the server (will turn it off in a week)
password rehlds
connect 31.31.73.85

test map
longjumptest.zip

Thanks

Sometimes players start flying or fall under the ground

A screenshot for illustrating the problem:
de_aztec0000

Short description

Delta encoder, when using some entity as a baseline to encode changes of another entity, doesn't take into account that some fields could be 'switched off' by the gamedll for baseline entity when it was delta-encoded.

Steps to reproduce

(success rate is not 100%, it depends on map and position of players):
  1. Start hlds on de_aztec
  2. Join the server. You have to be the first player on the server (this increases chance to reproduce the bug)
  3. Join CT team
  4. Wait for some other players to join the server
  5. When round starts go upstairs to the B bomb spot
  6. Wait for other players to go upstairs
  7. Start demo recording (using record command on client)
  8. If you're lucky, most of the players should start flying

Technical background

Now let's see what's going on.

  1. You are the first player on the server (i.e. your data is stored in svs.client[0] and your entity index is 1)
  2. The second player (svs.clients[1]) have the same Z coord as you. (sv.edicts[1].v.origin[2] == sv.edicts[2].v.origin[2])
  3. You starts demo recording
  4. Your client doesn't send clc_delta in next cmd packet. client[0]->delta_sequence will become -1 because of that
  5. Server is going to transmit entities to your client, SV_EmitPacketEntities() is called
  6. Since client->delta_sequence == -1, sv_packet_nodelta is emitted
  7. sv_packet_nodelta means that delta encoder should not use previous entities' states to encode current states
  8. Entity of the first player (of you) is encoded using sv.baselines[1] as a baseline. However, gamedll sees that server is going transmit your own state to you, and unmarks ent->v.origin fields (because your own movement is calculated on client side)
  9. sv.edicts[1].v.origin fields are not transmitted to the client and will be 0.0f there
  10. Entity of the second player is encoded using first player's entity as a baseline (usually)
  11. Since first and second player have the same Z coord, sv.edicts[2].v.origin[2] will not be marked as changed and will not be transmitted
  12. When your client decodes delta for the second player, it will use origin[2] from the baseline (i.e. from edicts[1].origin[2])
  13. However, server didn't transmit sv.edicts[1].v.origin[2] because gamedll unmarked it
  14. sv.edicts[2].v.origin[2] will be set to 0.0f therefore
  15. If ground's z coord is lower that 0 in the x,y position of the player, the player will 'start flying'
  16. If ground's z coord is higher that 0 in the x,y position of the player, the player will 'fall under the ground'

Clients are dropped with the "server failed to transmit file 'AY&SY..." message

Server sometimes kicks one or more clients with "server failed to transmit file 'AY&SY..." message in client's console.

Reason

It happens because of invalid 'reuse compressed buffer' optimization in SV_UpdateToReliableMessages():

for (i = 0; i < g_psvs.maxclients; i++) {
    client = &g_psvs.clients[i];

    if (g_psv.reliable_datagram.cursize + client->netchan.message.cursize < client->netchan.message.maxsize)    {
        SZ_Write(&client->netchan.message, g_psv.reliable_datagram.data, g_psv.reliable_datagram.cursize);
    } else {
        Netchan_CreateFragments(TRUE, &client->netchan, &g_psv.reliable_datagram);
    }
}

This code writes server's reliable message into reliable message buffer of each connected client. If there is enough space in client's reliable buffer, server reliable message is written 'as is' via SZ_Write function. Otherwise fragments are created via Netchan_CreateFragments function. The key part here is that Netchan_CreateFragments overwrites contents of g_psv.reliable_datagram with compressed version of this buffer.

Consider the following scenario:

  1. g_psv.reliable_datagram doesn't fit into client N1 reliable buffer
  2. g_psv.reliable_datagram is compressed and overwritten by Netchan_CreateFragments() function
  3. g_psv.reliable_datagram fits into client N2 reliable buffer
  4. Contents of g_psv.reliable_datagram is written into client N2's reliable buffer 'as is' by SZ_Write() function
  5. Client N2 is not able to parse compressed data written by SZ_Write and will generate svc_bad error.

Info_ functions use strcpy() on overlapped buffers

Info_* functions use Q_strcpy (which is alias for strcpy) for operations on info buffer. Since copying is done on same info buffer, src and dst buffers may overlap each other, which is forbidden by C/C++ specification.

On Windows strcpy() appears to work fine with overlapped buffers while icc's optimized version of strcpy() on linux corrupts info buffer if dst and src are close to each other.

HLDS in GUI mode crashes on windows

HLDS with swds.dll from rehlds package crashes on windows if it is not started in console mode
Reason: GameServerData001 interface used in AdminServer.dll is not exposed by swds.dll

"Your .dll (cl_dlls/client.dll) differs from the server's" fix - accepting p48 clients

Hi

While I admire your work, especially the performance boost, the Re-HLDS is so good in mimicking HLDS 6153 behavior - as it keeps rejecting older clients (probably sending incorrect CRC).

I'm getting following error on client "Your .dll cl_dlls/client.dll differs from the server's". And then client disconnects.

Client and server's client.dll do match and I still get an error.
This error can be circumvented if you change few bytes in client-side hw.dll to skip the received CRC check for client.dll.

I also managed to circumvent this by replacing swds.dll with the one from build 5758 and having client.dll matching on client/server.
I tried to disassemble swds.dll and find and remove these checks but I failed.

I did couple of tests and debugging.
swds 6153 + serverside client.dll new --> error
swds 6153 + serverside client.dll old (same as clientside) --> error
swds 5758 + serverside client.dll new --> error
swds 5758 + serverside client.dll old (same as clientside) --> client can connect now, all is working
swds 5758 + serverside client.dll old + any (new/old) clientside client.dll always works.

I'm willing to be long-term tester, I'm having private server with public IP, running Opposing Force.
My goal is to make server accept all p48 clients (even those non-steam older ones, by using revemu)

All I'm asking you is to fix the infamous "your .dll(cl_dlls/client.dll) differs from the server's" error.
Could please have a look into the issue?
Let me know if you need more info, affected hl version or temporary RDP access to my server.

HLDS5758.zip

Thx!

Notification about unknown command in server console

В исходнике engine/cvar.cpp функции
qboolean Cvar_Command(void)
{
cvar_t *v;
const char *arg0 = Cmd_Argv(0);
const char *firstToken = Cvar_IsMultipleTokens(arg0);

if (firstToken)
{
    v = Cvar_FindVar(firstToken);
    if (v)
    {
        Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
        return TRUE;
    }
}
else
{
    v = Cvar_FindVar(arg0);
    if (v)
    {
        if (Cmd_Argc() == 1)
        {
            Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
        }
        else
        {
            if (v->flags & FCVAR_SPONLY && g_pcls.state >= ca_connecting && g_pcl.maxclients > 1)
            {
                Con_Printf("Can't set %s in multiplayer\n", v->name);
            }
            else
            {
                Cvar_Set(v->name, Cmd_Argv(1));
            }
        }

        return TRUE;
    }
}

return FALSE;

}

внести 2 раза код
else
{
Con_Printf("unknown command "%s"\n", arg0);
}

qboolean Cvar_Command(void)
{
cvar_t *v;
const char *arg0 = Cmd_Argv(0);
const char *firstToken = Cvar_IsMultipleTokens(arg0);

if (firstToken)
{
    v = Cvar_FindVar(firstToken);
    if (v)
    {
        Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
        return TRUE;
    }
    else
    {
        Con_Printf("unknown command \"%s\"\n", arg0);
    }
}
else
{
    v = Cvar_FindVar(arg0);
    if (v)
    {
        if (Cmd_Argc() == 1)
        {
            Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
        }
        else
        {
            if (v->flags & FCVAR_SPONLY && g_pcls.state >= ca_connecting && g_pcl.maxclients > 1)
            {
                Con_Printf("Can't set %s in multiplayer\n", v->name);
            }
            else
            {
                Cvar_Set(v->name, Cmd_Argv(1));
            }
        }

        return TRUE;
    }
    else
    {
        Con_Printf("unknown command \"%s\"\n", arg0);
    }
}

return FALSE;

}

Результат этому делу.
Вводим не известную команду hg
и получаем сообщение.

unknown command "hg"

Так будет удобнее :)
Хотелось бы это видеть в релизе.
С уважением индус кодерь ;)

Too slow spray uploading

Client starts upload spray while he is connecting, but when client is connecting CL_GetFragmentSize always return 128. (it returns cl_dlmax only if client state is ca_active)
What about to move upload request code into SV_SendEnts_f function?

reHLDS UDP Queries /PHP/

How to get information like server name, players, max players, players list, map, os and etc.. ?
On the web there are bunch of working variants for HLDS, but now for reHLDS i cannot get properly information about the server.
The mainserverinfo is \xFF\xFF\xFF\xFFTSource Engine Query\x00 or something new ?
Can someone give me working variant for php ?

Sprays not working correctly.

Many (All?) custom sprays are not working.

Steps to reproduce:
1)Set the following example tempdecal.wad (https://www.sendspace.com/file/lfwbds) in your client cstrike directory.
2)Try to connect to ReHLDS server (make sure sv_allowuploads 1).

Client will get stuck in "Precaching resources..."

Same steps on regular HLDS result in client connecting properly and spray showing properly.

If sv_allowuploads is set to 0, then client will be able to connect (sprays won't show of course).

Also, related to this are segfault crashes after changelevel.

This line

Q_memcpy(&newdirectory.p_rgEntries[i + 1], &olddirectory.p_rgEntries[i + 1], sizeof(hash_pack_entry_t));

Will result in segfault at random after changelevel (most likely related to what the clients' sprays are).
This gets called from

void HPAK_FlushHostQueue(void)

which gets called from

void EXT_FUNC SV_ActivateServer_internal(int runPhysics)

(Github isn't accepting my zip file)
https://www.sendspace.com/file/lfwbds

Add possibility to write multiline kick reasons

I want something like this:
kick #1 \nUpdate anti-cheat, you can download it here:\nhttp://github.com/
will show:

You have been disconnected from the server.
Reason: Kicked :
Update anti-cheat, you can download it here:
http://github.com/

Raise precache limit

Could you raise the precache limit? 512 is not enough for fun servers such as zombie plague and jailbreak...

Name Change

The server will change player names seemingly at random for about 5 minutes after start then it will be fine after.
Also is there some way to increase the string ban limit. Some players are getting banned for using buyscripts.

Bug with integer conversion in MSG_WriteBitString

If string has non-ASCII chars (code >= 0x80) then MSG_WriteBitString will write 0xFF but not char code. There is a problem with conversion from int8 to uint32 (http://en.cppreference.com/w/cpp/language/implicit_cast#Integral_conversions):

If the destination type is unsigned, the resulting value is the smallest unsigned value equal to the source value modulo 2^n where n is the number of bits used to represent the destination type.

That is, depending on whether the destination type is wider or narrower, signed integers are sign-extended or truncated and unsigned integers are zero-extended or truncated respectively.

How it works:

  1. For example we have char with 0xAA (-86) code
  2. It is sign-extend to 32 bits, now we have 0xFFFFFFAA
  3. MSG_WriteBits checks for max value (for 8 bits it is 0xFF), but 0xFFFFFFAA is higher than 0xFF => now value is 0xFF
  4. MSG_WriteBits writes 0xFF

You can test it here: http://cpp.sh/4a6i

#include <cstdio>
#include <cstdint>

using namespace std;

int main() {
    signed char a;
    scanf("%hhd", &a);
    uint32_t b = a;
    printf("%.8X\n", b);

    unsigned char c;
    scanf("%hhu", &c);
    uint32_t d = c;
    printf("%.8X\n", d);
}

ReHLDS does not handle pingboost commandline option

i don't know how should i prove it. i think it's not necessary. everyone can test it. may i'm not the only one who tried to figure out what's wrong. i compared the ReHLDS latest stable and some recent snapshots with the original HLDS. the result is that pingboost does not affects on ReHLDS. no matter what value i use and what version i try it does not set any priorities.

Voice_GetClientListening uses iReceiver in wrong way

One day I noticed that something was wrong with this function and I decided to check the correctness of its work.
I test it with this code:

for (size_t nReceiver = 1; nReceiver <= 32; nReceiver++) {
    for (size_t nSender = 1; nSender <= 32; nSender++) {
        g_engfuncs.pfnVoice_SetClientListening(nReceiver, nSender, true);

        ALERT(at_console, "IsListening? %u %u %s\n", nReceiver, nSender, g_engfuncs.pfnVoice_GetClientListening(nReceiver, nSender) ? "true" : "false");
    }
}

And the results were unexpected:

IsListening? 1 1 true
...
IsListening? 1 32 true
IsListening? 2 1 false
...
IsListening? 32 32 false

This function works properly only for receiver with index 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.