-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Request / Bug] Add Player.GetUniqueId method #54
Comments
sorry i cant EDIT the title of this ticket. |
It should be added to g_EngineFuncs.GetPlayerUniqueId(edict_t@ pEdict) |
Well you call it pollution, i call it object orientation ;) Well and some other points:
And by the way pollution: ... Or what may be the .BloodColor() of a multimanager ? -___- |
Regarding the OO design, that's a subjective matter. However, I agree they could be on the I wouldn't wan't the methods the looks up information about the client within a class describing the Player entity. Those are very distinct from each other. |
And while this statement is completely true (a client and a player-entity being 2 different things), one should on the other hand never design an API from the perspective of internal programming / organizational details. And its not the API-users concern, to distinguish such details nor to search for hidden / far fetched helper classes. Imo, the player objects from the CBasePlayer interface should represent a "valid and fully connected client". Either being actually playing in the world, or observing the game with no physical representation. But it should be the one and only point / interface to handle those connected players/clients consistently. I am very aware of that shift of responsibility into many, (mostly static) helper classes in the world of C/C++/openGL, since i programmed a lot in this area. I am only seeing the AngelScript layer as an opportunity, for mapping those archaic patterns onto a modern OO-Design, which is easy and efficient to work with. (where efficient means, efficient for those plugin coders / mappers, who are new to the project and/or HL1SDK and/or missed the C-era). As for now, the API only exposes the HL1SDK api, which has an highly outdated, non-OO design (for example having all entity members on CBaseEntity and doing CHECKS, which object "class" we have). And some concepts may not even fit the needs of SC anymore (like the Observer-Player problem mentioned above). So yea, this is an opportunity. If you seize it (and have the time to) - up to you guys :) //EDIT: on a sidenote: the Clients name could also be retrieved over an engine helper function. but its player.pev.netname; |
I agree that it would make it easier for a user to use the language as it was intended rather than having to jump through hoops to figure out how the API works, that also being the result of lacking documentation from the SC team. However, the current way that AngelScript has been implemented into the SC codebase seems to make this far less trivial to change. Another point is that the closer the script API is mapped to the backend codebase—even though being archaic as you describe it—makes it easier to understand when reading similar source code either from HL1SDK or Xash to understand how these things were originally implemented to mimic the same behaviour—which in turn could also make debugging easier, as you'd expect the outcome to be 1:1 with the original implementation. |
the current way of getting a Unique ID is unreliable:
requesting:
pPlayer.GetUniqueId() ........ Returns a unique id for reliable identification. It doesn't change over server restarts. (in most cases, this is the STEAM_ID)
How BOTS and LAN players are handled, is not the Programmers concern, nor should he get the option to solve it inefficiently (string comparison)
The text was updated successfully, but these errors were encountered: