GithubHelp home page GithubHelp logo

[Question] HTTP and Gamerules about cs2fixes HOT 3 CLOSED

Gawnz1 avatar Gawnz1 commented on July 26, 2024
[Question] HTTP and Gamerules

from cs2fixes.

Comments (3)

axl303 avatar axl303 commented on July 26, 2024 1

The second question is how can I detect the TerminateRound from Gamerules and block a specific event like game commencing (Gamestart)? https://github.com/Source2ZE/CS2Fixes/blob/main/src/cs2_sdk/entity/cgamerules.h

You need to hook or detect the TerminateRound event for this.
In sourcemod was OnTerminateRound, then you need to check the reason of termination e.g GameStart, but here I am not sure how things work.

Maybe in this detour (I am just guessing):

void FASTCALL Detour_CGameRules_Constructor(CGameRules *pThis)

Or you need to hook the event somewhere else, not fully sure and don't know how to do it.
Just trying to help and gave you some information that I think it can help you a bit.

from cs2fixes.

Vauff avatar Vauff commented on July 26, 2024 1

Future questions can go to our Discord, for faster response.

How to use/how to make a HTTP request When I try to make a request using command: !http get domain.com it always prints a message: HTTP request to domain.com failed with status code 0

Is is something from my side or not using something correctly? OS is linux debian 12

Our HTTP API is only built for interacting with REST API's, domain.com is simply a normal website not implementing REST standards, thus it won't work.

The second question is how can I detect the TerminateRound from Gamerules and block a specific event like game commencing (Gamestart)? https://github.com/Source2ZE/CS2Fixes/blob/main/src/cs2_sdk/entity/cgamerules.h

The sig is already available in gamedata as CGameRules_TerminateRound, so just declare a detour and define it like the other detours are below, using the function definition from here.

from cs2fixes.

Gawnz1 avatar Gawnz1 commented on July 26, 2024

Thank you for the information!

You need to hook or detect the TerminateRound event for this. In sourcemod was OnTerminateRound, then you need to check the reason of termination e.g GameStart, but here I am not sure how things work.

From where I can hook/detect this event OnTerminateRound
I see the server fires TerminateRound when it ends a round in the server console, then probably I need to check if the event is "GameStart" and use return? to block it?

Maybe in this detour (I am just guessing):

void FASTCALL Detour_CGameRules_Constructor(CGameRules *pThis)

If I try to detect it in "Detour_CGameRules_Constructor" with if check and then use return, the server hangs (crash/stop)
I think should be done somewhere else.

If someone more familiar with this thing/done this thing, can you give a little help or a direction 🙏

from cs2fixes.

Related Issues (20)

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.