IClient
Hi,
So, i was trying to kick a client after connecting if they were not able to join the server, but the server keeps crashing when i am trying to cast the msg to the IClient interface. I already read the sourcemod source code, and i am pretty sure that's how it is doing the job, but i am missing something that i cant figure it out. I import the class CPlayer from the source code, and i am calling the method Initialize on the event OnClientConnected , thats where is crashing the server. Code:
|
Re: IClient
static_casting pointers is a noop. It's not the cause of your crash.
Off the top of my head, check to make sure all your pointers are valid. The code only checks pNetchan. The INetChan or IPlayerInfo layouts could be different between the headers and the server, but this is probably not the problem if SM works and you're using the same ones. |
Re: IClient
Hi, thanks for the reply.
I based my code from here: https://github.com/alliedmodders/sou...ager.cpp#L1982 That method is called from PlayerManager::OnClientConnect, thats what i did :( The server crash's exacly on this line, i make sure of that putting some debug print's IClient *pClient = static_cast<IClient *>(pNetChan->GetMsgHandler()); |
Re: IClient
Hummm, the problem is resolved.
I am not sure what was the problem, i just re-downloaded the sdk for cs go and it started working. Thanks anyway.... |
Re: IClient
If the layout of INetChan changes (which can happen when the game patches) and you're using an older revision of the SDK, then calling its functions can break depending on what the change was. The SDK has to be updated to match it.
|
Re: IClient
Quote:
|
All times are GMT -4. The time now is 02:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.