Raised This Month: $32 Target: $400
 8% 

Unique game id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kris Kristensen
Junior Member
Join Date: May 2020
Old 05-05-2020 , 04:40   Unique game id
Reply With Quote #1

Hello,

CSGO question

I am a complete newbie in this language, however a fairly competent developer in c++/java. I have a question regarding unique game id. I do not mean STEAMID, but a completely unique identifier for a particular match, regardless of it being a competitive, training or whatever.

Is there a function in sourcemod i can call to get such an identifier, or do I need to create one myself, which is perfectly fine in my case - I just need a hint how to do that, if that's the case.

Best
Kris
Kris Kristensen is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-05-2020 , 05:23   Re: Unique game id
Reply With Quote #2

Quote:
Originally Posted by Kris Kristensen View Post
Hello,

CSGO question

I am a complete newbie in this language, however a fairly competent developer in c++/java. I have a question regarding unique game id. I do not mean STEAMID, but a completely unique identifier for a particular match, regardless of it being a competitive, training or whatever.

Is there a function in sourcemod i can call to get such an identifier, or do I need to create one myself, which is perfectly fine in my case - I just need a hint how to do that, if that's the case.

Best
Kris
don't think there is a "unique identifier for a particular match"
so create one yourself
__________________
8guawong is offline
Kris Kristensen
Junior Member
Join Date: May 2020
Old 05-05-2020 , 05:28   Re: Unique game id
Reply With Quote #3

Thanks' for your reply,

would you be kind enough to write some snippets as to how I should go about with that in a plugin, just to get me started...?

Thanks
Kris
Kris Kristensen is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-05-2020 , 07:37   Re: Unique game id
Reply With Quote #4

Quote:
Originally Posted by Kris Kristensen View Post
Thanks' for your reply,

would you be kind enough to write some snippets as to how I should go about with that in a plugin, just to get me started...?

Thanks
Kris
sorry i do not know what exactly you are looking for and how you intend on using this "unique identifier for a particular match" therefore i can't give you any snippets to get you started
__________________
8guawong is offline
Kris Kristensen
Junior Member
Join Date: May 2020
Old 05-05-2020 , 09:33   Re: Unique game id
Reply With Quote #5

Hi again,

No, I agree - this needs to be clarified. Sorry for my rude attempt to make you write code, without explaining the gameplay.

Basically what I need is a way to identify a match, assuming that my server is running concurrent games. I understand that a unique identifier is not an option. That's fine, now, I imagine the following flow:

User logs into my server (community server). The user is requested to enter a pincode before actually allowed in on the server. If the user's pin is correct the game will go into warmup mode, until at least one other opponent (not BOT) enters the game. The new enterer will also have to enter his code, and if validated correctly, he will be let into the server, and a new warmup of 1 minute commences. After that - normal gameplay.

I know a couple of the building blocks here, but the one with the input field for pincode, is that even possible? It won't work pressing Y or ~ for chat/console for input, as the code must be entered as part of the "PutInServer" logic somehow. If the user enter the wrong code, he'll be kicked from the server

Best
Kris

Last edited by Kris Kristensen; 05-05-2020 at 09:35.
Kris Kristensen is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 05-05-2020 , 12:13   Re: Unique game id
Reply With Quote #6

Quote:
Originally Posted by Kris Kristensen View Post
Hi again,

No, I agree - this needs to be clarified. Sorry for my rude attempt to make you write code, without explaining the gameplay.

Basically what I need is a way to identify a match, assuming that my server is running concurrent games. I understand that a unique identifier is not an option. That's fine, now, I imagine the following flow:

User logs into my server (community server). The user is requested to enter a pincode before actually allowed in on the server. If the user's pin is correct the game will go into warmup mode, until at least one other opponent (not BOT) enters the game. The new enterer will also have to enter his code, and if validated correctly, he will be let into the server, and a new warmup of 1 minute commences. After that - normal gameplay.

I know a couple of the building blocks here, but the one with the input field for pincode, is that even possible? It won't work pressing Y or ~ for chat/console for input, as the code must be entered as part of the "PutInServer" logic somehow. If the user enter the wrong code, he'll be kicked from the server

Best
Kris
its probably doable but i don't think a snippet will help you
there are different ways to achieve what you want (i'm guessing private servers)
you can use sv_password and just give it to players you want
you can use sever whitelist https://www.sourcemod.net/plugins.ph...tion=&search=1
__________________
8guawong is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-05-2020 , 14:17   Re: Unique game id
Reply With Quote #7

*edit
I'm actually lost, what op is asking, tough

yeah... using whitelist by steamID's or set random sv_password to server are easier.
Or you let player connect to inside server, then you give him time to accomplish PIN code, or something.


- There is one trick, what SoureMod admin system use, for password access.
Player command: setinfo <key> <value>

Example:
- Before player connect to "match server", he need set PIN code first, in his console.
Code:
setinfo special_password bv070
- Now when player make connect to server, you can check player info in early state
PHP Code:
public bool OnClientConnect(int clientchar[] rejectmsgint maxlen)
{
    
char PIN[10];
    
GetClientInfo(client"special_password"PINsizeof(PIN));
    
PrintToServer("PIN %s"PIN);

    return 
true// when you want player get in server, return as true!

To block player connecting to server, return bool OnClientConnect as false.
You can also re-format rejectmsg disconnect message.

------------------------------------------------------------------------------------------
Spoiler
Attached Thumbnails
Click image for larger version

Name:	setinfopin.png
Views:	87
Size:	37.2 KB
ID:	181217  
Attached Files
File Type: txt matchpincodes.txt (674 Bytes, 55 views)
__________________
Do not Private Message @me

Last edited by Bacardi; 05-05-2020 at 14:18.
Bacardi is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 05-06-2020 , 10:41   Re: Unique game id
Reply With Quote #8

What am I missing that he can't simply used sv_password?
__________________
zipcore is offline
Kris Kristensen
Junior Member
Join Date: May 2020
Old 05-07-2020 , 08:51   Re: Unique game id
Reply With Quote #9

Quote:
Originally Posted by Bacardi View Post
*edit
I'm actually lost, what op is asking, tough

yeah... using whitelist by steamID's or set random sv_password to server are easier.
Or you let player connect to inside server, then you give him time to accomplish PIN code, or something.


- There is one trick, what SoureMod admin system use, for password access.
Player command: setinfo <key> <value>

Example:
- Before player connect to "match server", he need set PIN code first, in his console.
Code:
setinfo special_password bv070
- Now when player make connect to server, you can check player info in early state
PHP Code:
public bool OnClientConnect(int clientchar[] rejectmsgint maxlen)
{
    
char PIN[10];
    
GetClientInfo(client"special_password"PINsizeof(PIN));
    
PrintToServer("PIN %s"PIN);

    return 
true// when you want player get in server, return as true!

To block player connecting to server, return bool OnClientConnect as false.
You can also re-format rejectmsg disconnect message.

------------------------------------------------------------------------------------------
Spoiler
Hello and thanks a lot for your example here.

Let me first clarify why sv_password won't do. Well we are already using sv_password but running multiple game instances on the same server is a bit hard to administer, and what I would like to do is simply send a pincode to the player, have him enter that, and if validated - let in to the server. Therefore my initial idea was to show an input field or a dialog in the client for the player to enter this pincode in.
Hope this clarifies it a bit
Kris Kristensen is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 05-07-2020 , 12:36   Re: Unique game id
Reply With Quote #10

Create bash script to automate copy server_pin.cfg with "sv_password new_pin" to folders of each game cfg directory. Don't forget about correct ACL.
In each server.cfg write "exec server_pin.cfg"

Or create program in C++/java (if you already know them) to connect to rcon of each game server to pass "sm_pin new_pin" command. Create plugin that accept "sm_pin" command (and redirect pin to sv_password ConVar) and put him to each game. Don't forget to change server.cfg sv_password as well in this case since it is executed each new map, like you can do same as above - overwrite server_pin.cfg using plugin.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 05-07-2020 at 12:42.
Dragokas is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode