Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSGO] Native "BfRead.BytesLeft.get" was not found #945

Closed
ambaca opened this issue Jan 1, 2019 · 1 comment

Comments

@ambaca
Copy link

@ambaca ambaca commented Jan 1, 2019

Help us help you

  • I have checked that my issue doesn't exist yet.
  • I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • I can always reproduce the issue with the provided description below.

Environment

  • Operating System version:
    Windows 10 Home 1803 (17134.472)

  • Game/AppID (with version if applicable):
    Protocol version 13672 [847/847]
    Exe version 1.36.7.2 (csgo)
    Exe build: 18:27:04 Dec 12 2018 (7331) (730)
    Windows version 6.2

  • Current SourceMod version:
    sourcemod-1.9.0-git6272-windows

  • Current SourceMod snapshot:
    sourcemod-1.10.0-git6373-windows

  • Current Metamod: Source snapshot:
    mmsource-1.11.0-git1116-windows

Description

Plugin fail load in CSGO game (Protobuf) when you have this in code:
https://sm.alliedmods.net/new-api/bitbuffer/BfRead/BytesLeft

But this work https://sm.alliedmods.net/new-api/bitbuffer/BfGetNumBytesLeft

Idea was make plugin to work on both, Protobuf and Bitbuffer.

This is not huge deal touhg.

Problematic Code (or Steps to Reproduce)

// TODO(you): code here to reproduce the problem
public void OnPluginStart()
{
  HookUserMessage(GetUserMessageId("SayText2"), msg_hook, false);
}

public Action msg_hook(UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init)
{


  if(GetUserMessageType() == UM_Protobuf)
  {
  	
  }
  else
  {
  	char buffer[200];

  	// BfGetNumBytesLeft(view_as<Handle>(msg) // workaround solution

  	while(UserMessageToBfRead(msg).BytesLeft)
  	{
  		UserMessageToBfRead(msg).ReadString(buffer, sizeof(buffer));
  		PrintToServer("-%s", buffer);
  	}
  }

  return Plugin_Continue;
}

Logs

SourceMod Version: 1.9.0.6272
L 01/01/2019 - 21:40:48: [SM] Failed to load plugin "test.smx": Unable to load plugin (no debug string table).
SourceMod Version: 1.10.0.6373
L 12/31/2018 - 13:32:19: [SM] Unable to load plugin "test.smx": Native "BfRead.BytesLeft.get" was not found
  • Please attach in separate files: game output, library logs, kernel logs, and any other supporting information.
  • In case of a crash, please attach minidump or dump analyze output.
@psychonic psychonic closed this in 821251b Jan 1, 2019
@psychonic

This comment has been minimized.

Copy link
Member

@psychonic psychonic commented Jan 1, 2019

Thanks for the report. I've pushed a fix for this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.