Need help to get Offline-User


  • Hi There!

    I'm working on a way to unclaim a users property.
    Currently this is what I have:

    Player OtherPlayer = UserManager.FindUser("R4mbo").Player;
    PropertyManager.UnclaimProperty (OtherPlayer);

    The problem I have is: It finds only online Players.
    I need to somehow get the "Player" from a person which is offline.

    Any quick Idea?
    I know Devs already work on a way to let Admins unclaim any properties, but until then I would like to have a fast fix, since there are some problems with griefers on our Server.

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)


  • 9
    Posts
    2436
    Views
    Log in to reply


  • OK... it seems a User is detected...
    I think I figured out how it works...
    User = all Users
    User.Player / Player are only the Player Instances of the Users which are currently active.... so I have to find a way to remove Properties of Users, not Players, therefore need another command...

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)



  • Right, player only exists while the player is connected to the server and will null otherwise. All saved player data lies on their User object.



  • This makes me mad ...
    I won't give up ;P

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)



  • That means... a Plot can only be unclaimed if the Owner is online... as far as I can see..

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)



  • that method is just using the current players position to remove the plot where they are standing - you'll need a different solution to remove it otherwise.

    Is there a bug for this command? If not please add one and we can make it.



  • OK, I found a mad solution...
    creating a dummy-Player for an offline-User, Teleporting it to the Admins Location, unclaiming the Property, removing dummyplayer... job done...

    Now I just need to test often enough, since it could break something and to enhance it...

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)



  • noblackthunder is already working on an official command.
    Until it is released I gonna provide a mod which does the job.
    https://github.com/StrangeLoopGames/EcoIssues/issues/960

    Unfortunately I didn't find a direct way to unclaim land which is claimed by another User.
    So my workaround is to use

    User OtherUser = UserManager.FindUser("OtherUserName");
    Player Bot = new Player (OtherUser.Name, 30f, null);
    OtherUser.OnLogin (Bot, null);
    Bot.SetPosition (player.Position);
    PropertyManager.UnclaimProperty (Bot);
    NetObjectManager.Remove(Bot);
    OtherUser.OnLogout ();

    ... kinda funny.

    Do you like my mods? I would be thankful for a small donation^^.
    ETH: 0x24d8FCA487EF62d58f0e926c4c7E21B3ca10f782
    Doge: DQrTnvtf8qPe6dzCLZUpbkEAC1DfAsmzHN
    Eco-Coin: EqQQEGe89dgG3F9893rODI (just joking)



  • Howdy @R4mbo Did already my first pass on that , Though i am not a coder and did that in my spare time. I created a pull request and asked if eric can help me with that. right now he his working on some more important bugs so no guarantees when it will come in game since Eric needs to do some fixing on my code. I also did not manage to figure out how to do the plot thing ( kinda a bit to complicated to find out where i need to go to get that data and how to do that. I think you have to expand some core code to get that to work in a good way ? )


9
Posts
2436
Views
Log in to reply

Internal error.

Oops! Looks like something went wrong!