Zapis expa (steam SID, non-steam na nick)
Shodd
11.12.2015
Witam wszystkich mam problem na serwerze z zapisywaniem exp'a, posiadam w silniku własnoręcznie pisany plugin expmod'a i nie wiem jak ustawić aby graczom (non-steam) po zmianie mapy zapisywało zdobyty exp na nick (ze względu zmiennych ip) - natomiast dla steamowców zapisuję tak jak należy na SID.
1. ustawienia zapisu exp'a dla non steamowców na nick trzeba dopisać w pluginie exp moda? (żeby nie sprawiał problemu z zapisem dla steam na SID) czy wzrok skierować bardziej na pliki konfiguracyjne (.cfg czy coś)
dzięki za każdą pomocną odpowiedź
Użytkownik Shodd edytował ten post 11.12.2015 10:28
Kowalsky
11.12.2015
Nie wiemy co znaczy własnoręcznie pisany... Nie wiemy co tam masz, czy możesz to skonfigurować cvarami...
Przykład poniższego kodu pozwoli zapisać Ci różne rzeczy zależnie od tego czy gracz ma steam, czy non steam.
Aby działało to poprawnie trzeba ustawić dproto dla graczy non steam, aby zaczynało się od "VALVE_"
public jakas_funcja_do_zapisywania(id) { new sName[32], sAuthID[64]; new sQuery[512]; get_user_name(id, sName, 31) get_user_authid(id, sAuthID, 63) if(is_user_steam(id)) formatex(sQuery, 511, "UPDATE `expmod` SET `exp` = '%i' WHERE `steam_id` = '%s'", iExp, sAuthID) else formatex(sQuery, 511, "UPDATE `expmod` SET `exp` = '%i' WHERE `nick` = '%s'", iExp, sName) } stock is_user_steam(id) { new sAuthID[64]; get_user_authid(id, sAuthID, 63) if(containi(sAuthID, "STEAM_")) return true; else return false; return PLUGIN_CONTINUE; }
Shodd
11.12.2015
public wczytaj_exp(id){ new vaultkey[32],vaultdata[512] new authid[32], name[32] get_user_authid(id,authid,31) if(equal(authid, "STEAM_ID_LAN", 31)) { get_user_name(id, name, 31) format(vaultkey, 31, "%s", name) } else if(equal(authid,"STEAM_0:" ,8)) { format(vaultkey, 31, "%s", authid) } else return nvault_get(zapis,vaultkey,vaultdata,511) replace_all(vaultdata,256,"#"," ") new jeden[100],dwa[100],trzy[100],cztery[100],piec[100],szesc[100],siedem[100],osiem[100],dziew[100],dzies[100],jedenascie[100],dwanascie[100],trzynascie[100]
public zapisz_exp(id){ new vaultkey[32],vaultdata[512] new authid[32], name[32] get_user_authid(id,authid,31) if(equal(authid, "STEAM_ID_LAN", 31)) { get_user_name(id, name, 31) format(vaultkey, 31, "%s", name) } else if(equal(authid,"STEAM_0:" ,8)) { format(vaultkey, 31, "%s", authid) } else return
Trzeba dopisać/przerobić coś w pliku .sma expmoda aby zapisywało na nick dla nsów?
Shodd
11.12.2015
Nie wiemy co znaczy własnoręcznie pisany... Nie wiemy co tam masz, czy możesz to skonfigurować cvarami...
Przykład poniższego kodu pozwoli zapisać Ci różne rzeczy zależnie od tego czy gracz ma steam, czy non steam.
Aby działało to poprawnie trzeba ustawić dproto dla graczy non steam, aby zaczynało się od "VALVE_"
public jakas_funcja_do_zapisywania(id) { new sName[32], sAuthID[64]; new sQuery[512]; get_user_name(id, sName, 31) get_user_authid(id, sAuthID, 63) if(is_user_steam(id)) formatex(sQuery, 511, "UPDATE `expmod` SET `exp` = '%i' WHERE `steam_id` = '%s'", iExp, sAuthID) else formatex(sQuery, 511, "UPDATE `expmod` SET `exp` = '%i' WHERE `nick` = '%s'", iExp, sName) } stock is_user_steam(id) { new sAuthID[64]; get_user_authid(id, sAuthID, 63) if(containi(sAuthID, "STEAM_")) return true; else return false; return PLUGIN_CONTINUE; }
if(is_user_steam(id)) formatex(sQuery, 511, "UPDATE `expmod` SET `exp` = '%i' WHERE `steam_id` = '%s'", iExp, sAuthID) else formatex(sQuery, 511, "UPDATE `expmod` SET `exp` = '%i' WHERE `nick` = '%s'", iExp, sName)
to jest kod do zapisywania exp'a tylko na steam czy S/NS? chodzi mi o to
SET `exp` = '%i' WHERE `steam_id` - steam?
SET `exp` = '%i' WHERE `nick` - nonsteam?
Kowalsky
11.12.2015
Ale z tego co widzę to ludzie którzy mają STEAM_ID_LAN mają zapis na nick, a pozostali na SteamID.
Jeżeli masz prawidłowo skonfigurowane dproto to powinno działać (chyba, że reszta kodu jest skopana).
Shodd
11.12.2015
cięzko mi się w tym połapać trochę, wyczytałem na internecie coś takiego
Emulowanie SteamID dla nonsteam Wiem, jak niektórzy mają problem żeby w amxbans odbanować nonsteama... Jest na to sposób Szukamy w dproto.cfg cid_NoSteam47 = 8 cid_NoSteam48 = 10 I zamieniamy na cid_NoSteam47 = 3 cid_NoSteam48 = 3 Restart i już każdy NS ma wygenerowane z IP stałe steamID.
Odnośnie amxbans ale może zmiana tego cid_NoSteam pomoże, tylko teraz nie wiem czy wina leży w konfiguracji dproto czy w kodzie pluginu
+ wyciąg z dproto.cfg
# # General rule for modifying this file: # DONT CHANGE ANYTHING IF YOU DONT KNOW WHAT IT MEANS # # ======================================================== # DPROTO CONFIGURATION # ======================================================== # LoggingMode: # 1 = Console # 2 = Log Files # 3 = Both LoggingMode = 2 # ======================================================== # AUTHID MANAGEMENT # ======================================================== # ClientID types (for cid_* options) # 1: Real (or generated by HW) steam (STEAM_xx:xx:xx) # 2: Real (or generated by HW) valve (VALVE_xx:xx:xx) # 3: STEAM_ by IP # 4: VALVE_ by IP # 5: Deprecated - client will be rejected # 6: reserved for future use # 7: HLTV # 8: STEAM_ID_LAN # 9: STEAM_ID_PENDING # 10: VALVE_ID_LAN # 11: VALVE_ID_PENDING # 12: STEAM_666:88:666 # Use these options to set authid's for clients # for HLTV (default is HLTV [7] ) cid_HLTV = 7 # for p.47 clients that do not support unique id generation (default is STEAM_ID_LAN [8] ) cid_NoSteam47 = 8 # for p.48 clients that do not support unique id generation (default is VALVE_ID_LAN [10] ) cid_NoSteam48 = 10 # For Legit Steam clients (default is real STEAM_xx:xx:xx [1]) cid_Steam = 1 # Client recognized as pending when they sucessfully authorized, but did not get steam id # REMARK: Actually, it got steamid, but it is useless (STEAM_0:0:0 for example) # default is STEAM_ID_PENDGIND [9] cid_SteamPending = 9 # For players having revEmu ( >= 9.74) on client-side: # default is real STEAM_xx:xx:xx [1] cid_RevEmu = 1 # For players having SteamClient 2009 / revEmu > 9.82 on client-side: # default is real STEAM_xx:xx:xx [1] cid_SC2009 = 1 # For players having old revEmu on client-side: # default is real STEAM_xx:xx:xx [1] cid_OldRevEmu = 1 # For players having hCupa's SteamEmu on client-side: # default is real STEAM_xx:xx:xx [1] cid_SteamEmu = 1 # For players having AVSMP (Cracked Steam) on client-side: # default is real STEAM_xx:xx:xx [1] cid_AVSMP = 1 # For SETTI ServerScanner # default is STEAM_xx:xx:xx generated by IP [3] cid_Setti = 3 # For SXEI Clients # default is real STEAM_xx:xx:xx [1] cid_SXEI = 1 # EnableSXEIdGeneration (0 / 1) # Turns on steamid generation based on info sent by sXeI client # Enable this only if you have sXeI server installed! EnableSXEIdGeneration = 0 # SC2009_RevCompatMode (0 / 1) # Enable fix to make steamids generated for SC2009 compatibble with revEmu SC2009_RevCompatMode = 1 # SteamEmuCompatMode (0 / 1) # An analog for eSTEAMATiON's EnforceSteamEmuCompatIDMode option. # Affects only Old RevEmu and SteamEmu emulators. SteamEmuCompatMode = 1 # OldEstCompatMode (0 / 1) # Enables/Disables fix for steamids generated by eST in 0.3.1 version. # Set this to 1 if you want to make steamids generated by eST as in < 0.3.0 versions. OldEstCompatMode = 0 # IPGen_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids generated by IP IPGen_Prefix1 = 0 # IPGen_Prefix2 (int) # STEAM_a:b:c # second prefix (b) for authids generated by IP IPGen_Prefix2 = 4 # Native_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids generated by native auth method (Steam) Native_Prefix1 = 0; # RevEmu_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids generated by Steamclient 2009 SC2009_Prefix1 = 0; # RevEmu_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids generated by RevEmu RevEmu_Prefix1 = 0; # OldRevEmu_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids generated by old RevEmu OldRevEmu_Prefix1 = 0; # SteamEmu_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids generated by SteamEmu SteamEmu_Prefix1 = 0; # SteamEmu_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids assigned for AVSMP Clients (Cracked steam) AVSMP_Prefix1 = 0; # Setti_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids assigned for Setti server scanner Setti_Prefix1 = 0; # SXEI_Prefix1 (int) # STEAM_a:b:c # first prefix (a) for authids assigned for sXeI clients SXEI_Prefix1 = 0; # Note that banid will use steamid WITHOUT any prefixes! # ======================================================== # ATTACKS SUPRESSION # ======================================================== # FakePlayers_ConnectInitiationCheck (seconds) # Sets the time, in seconds, in which client should initiate # game session (in other words, send the "new" command) after it has # been connected. If client did not initiated game session, it will be marked as # fake and kicked. # Default is 6 seconds. # Use 0 to disable this check. FakePlayers_ConnectInitiationCheck = 6 # FakePlayers_ClientValidationCheck (seconds) # Sets the time, in seconds, in which client should answer to random unique command # sent by server. If client did not answered for this command, it will be marked as # fake and kicked. # Default is 8 seconds. # Use 0 to disable this check. FakePlayers_ClientValidationCheck = 8 # FakePlayers_AntiReconnect (0/1) # Enables detection of fakeplayers that reconnects quickly (every < 10 seconds) # before fake players checks have completed. # This check will work only if FakePlayers_ClientValidationCheck and # FakePlayers_ConnectInitiationCheck are enabled. # Default is 1 (ON) FakePlayers_AntiReconnect = 1 # FakePlayers_BanTime (minutes) # Dproto will ban IP spamming fakeplayers for time (in minutes) specified in this variable # use 0 for permanent ban # use negative vaules to disable ban (fake players will only be kicked) FakePlayers_BanTime = 120 # ======================================================== # OTHER STUFF # ======================================================== # DisableNativeAuth (0/1) # Disables valve/steam auth system. # For p.47 Based: Server will not connect to auth servers. # For All: Server will not call authorization functions. # This is a fix for startup freeze for old (p.47) servers. DisableNativeAuth = 0 # ServerInfoAnswerType (0/1) # Sets server answer type for query requests # 0 = New style (Source Engine) # 1 = Old Style (Fix favorites list for p.47 clients) # 2 = Hybrid mode - best solution for now, server is visible anywhere ServerInfoAnswerType = 2 # Game_Name (string) # Sets game name displayed for clients # If Game_Name is empty, native game name will be used Game_Name = # Enables fix for proper player id displaing on HLStats server monitoring # Enable this only if you have HLStats HLStatsPlayerIdFix = 0 # ExportVersion (0 / 1) # Enables/Disables exporting of dp_version cvar # 1 = dp_version cvar will be exported to server rules. It will be visible in server monitoring tools (like HLSW) # 0 = dp_version cvar will not be exported to server rules. ExportVersion = 1 # HLTVExcept_IP (ip addr) # HLTV from this IP will be able to join the server even if cid_HLTV is set to 5 (deprectaed) HLTVExcept_IP = 127.0.0.1
Użytkownik Shodd edytował ten post 11.12.2015 10:53
Kowalsky
11.12.2015
cid_NoSteam48 cid_SteamPending cid_RevEmu cid_SC2009 cid_OldRevEmu cid_AVSMP cid_Setti cid_SXEI
Te wszystkie wartości ustaw na 8, a potem sprawdź czy non steam mają STEAM_ID_LAN w statusie.
Shodd
13.12.2015
@Kowalsky pomogło, teraz każdy ns nie zależnie od tego jaki ma nick posiada STEAM_ID_LAN, rozwiązane - można zamknąć