server without SafeWriting, is it possible?

Page:1 2 3 4 5 6 7 8 9  

  • golden_elite13

    Or maybe i can verify Them too ? I think all gercry profiles ids are values > 100000000, so if a value is not approved in crymp and not superior to this number => set a random id :D could it works ? ^^'

    ❤️ 0
  • Zi;

    Sure, you can handle them anyway you want. :D

    ❤️ 0
  • golden_elite13

    Thank you Zi; :) however I have to overwrite the function of GetProfileId() out of the command !validate, to make it permanent since patriot startup

    ❤️ 0
  • Zi;

    You can overwrite in OnClientConnect I think, that's ideal

    ❤️ 0
  • golden_elite13

    Okayy so I have added in the patriot gamerules file (which overwrites original gamerules) the function g_gameRules.Server:OnClientConnect(channelId, name, reset.. or some args like that) This function equals to the original game function but I added a new line after "local player = self:SpawnPlayer(channelId, name)" This line is OverwriteProfileIdFunction(player), who calls the following function when a player connects to server : function OverwriteProfileIdFunction(player) player.actor.parent=player; player.actor.GetProfileId = function(self) if (self.parent.profile) then return self.parent.profile -- But the function is not completed, -- I don't only want to return player.profile -- But before, verify if the original "player.actor:GetProfileId()" -- doesn't return a player ID =/= 0 -- if yes, return this ID. How to do this ? end end end

    ❤️ 0
  • Zi;

    Ummm, that's a really good question, but I think this should work: function OverwriteProfileIdFunction(player) player.actor.parent=player; if not player.actor.OriginalGetProfileId then player.actor.OriginalGetProfileId=player.actor.GetProfileId end player.actor.GetProfileId = function(self) if self.parent.profile then local originalId = self:OriginalGetProfileId() if tonumber(originalId)~=0 then --handle this however you want return originalId else return self.parent.profile end end end end Or just simply do this: function OverwriteProfileIdFunction(player) player.actor.parent=player; local originalId=player.actor:GetProfileId() if tonumber(originalId)~=0 then return originalId end --just return it right away, no rewriting needs to be done player.actor.GetProfileId = function(self) if self.parent.profile then return self.parent.profile end end end But I think first way is better, it's more general :D

    ❤️ 0
  • golden_elite13

    Thank you, i'm going to try this :D

    ❤️ 0
  • golden_elite13

    It would be great if the function work but I can't test it -_- The problem is.. the function "OnClientConnect" (at begin this event is not in patriot code but i added it myself and it don't works.. i already renamed it by all functions names i could think : InstantAction:OnClientConnect, g_gameRules:OnClientConnect etc.. but never changed : it is never called. I know it because i added a "System.LogAlways("This function is called") into the function but the message never appear... i tested if others events that already are in patriot gamerules.lua are called and yes , they work.. (they show a console message if i write System.LogAlways("blabla...) so my question is: how to get my function OverwriteProfileIdFunction called with a valid parameter 'player'.

    ❤️ 0
  • Disturbed

    golden_elite13 What do you want to do to create your own server side similar to Crymp.net?

    ❤️ 0
  • golden_elite13

    No such idea xD it's just i don't like safewriting , not too "comfortable" to me to use and program ^^' but There is no problem :) And thus i improve some of my "programming" and lua knowledge thx to Zi :)

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