server without SafeWriting, is it possible?

Page:1 2 3 4 5 6 7 8 9  

  • golden_elite13

    Here are my validating functions : (Picked in your SSM but simplified) function Master:AttemptValidate(player,pid,uid,name,attempt) local req = urlfmt("http://crymp.net/api/validate.php?prof=%s&uid=%s",pid,uid); local result = Master.RequestHTTP(req); if result then local err=string.find(result,"%Validation:Failed%",nil,true); if err then printf("Validation error: %s",tostring(err)); player.profile=math.random(800000,1000000); else printf("Validation success for %s/%s",name or "<unknown>",player:GetName() or "<unknown>"); player.profile=pid; g_gameRules.game:RenamePlayer(player.id, name); _G["ValidIds"]=_G["ValidIds"] or {}; _G["ValidIds"][uid]=pid; end else if attempt<4 then printf("Validation warning: %s , attempt: %d",tostring(error),attempt+1); AttemptValidate(player,pid,uid,name,attempt+1); else printf("Validation error: %s",tostring(error)); player.profile=math.random(800000,1000000); end end end AddChatCommand("validate", {args={"pid", "uid", "name"}, info="Used by sfwcl to login"}, function (player, pid, uid, name) Script.SetTimer(1,function() if pid and uid and name then local numpr=tonumber(pid); if numpr and uid=="200000" and numpr>=800000 and numpr<=1000000 then player.profile=pid; g_gameRules.game:RenamePlayer(player.id,name) return; end if _G["ValidIds"] and _G["ValidIds"][uid]==pid then player.profile=pid; g_gameRules.game:RenamePlayer(player.id,name) return; end Master:AttemptValidate(player,pid,uid,name,0); end end); end);

    ❤️ 0
  • Zi;

    Well, I think you can edit Phoenix functions though :D Like this: AddChatCommand("validate", ..., function(player, ...) player.actor.parent=player; player.actor.GetProfileId = function(self) return self.parent.profile; end; -- other your code end); In Lua you can overwrite existing functions on objects.

    ❤️ 0
  • golden_elite13

    It seems to be good to use but, when others patriot scripts call "player.actor:GetProfileId()", the result will be the same as here ? All the function is overwritten or it's simply here and i will get a profileID=0 on other patriot scripts ?

    ❤️ 0
  • golden_elite13

    The thing i want is : player.actor:GetProfileId() always return player.profile when the result is "0", or return the result of the original function when it is not 0 xD It is that on the all mod ?? (maybe i'm an idiot as well^^')

    ❤️ 0
  • golden_elite13

    Oh and it's not the only problem, i shown you my code because player.profile isn't retrieved with the http request :/ it gives a nil value. Maybe it's a problem with _G["ValidIds"], doesn't exist so it doesn't give the value to player.profile

    ❤️ 0
  • Zi;

    Overwriting function once should overwrite it everywhere for Patriot, so it should work. Original function will always return 0 anyway since GameSpy is down. So there is no reason to return old function. _G["ValidIds"] is created automaticaly inside :AttemptValidate, it serves just as cache for old known UIDs, so if player once checked, next time you will just reuse old values.

    ❤️ 0
  • Zi;

    What does your server write in logs, how far does it get? Does it assign player.profile=pid in :AttemptValidate?

    ❤️ 0
  • golden_elite13

    Okay , but for the old function it works for GerCry accounts because it overwrites gamespy profileID , So if one player hasn't sfw and want to play on my server with a valid profileID, he can (it was my case before, i used gercry on crymp servers because sfwcl doesnt work for me (always crashed :/ ) And for logs i can't tell this now i turned off my computer , go to school tomorrow xD i ´ll see that when i get time Thx for answers^^

    ❤️ 0
  • Zi;

    Well, it's really not good idea to trust GerCry IDs, because they can be spoofed, SSM SafeWriting treats them as 0 and overwrites them with random number from 800000 to 1000000, so you should do the same. CryMP IDs can't be spoofed, they are always verified by master in validation process, so you can fully trust them :D You know, it would suck if you have CryMP ID 17000, you set it as admin, then GerCry player comes with ID 17000 and suddenly he is admin?! :D That would be problem!

    ❤️ 0
  • golden_elite13

    Okay Zi ^^ in that case i'll not trust gercry IDs xD

    ❤️ 0
Page:1 2 3 4 5 6 7 8 9