Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

2 years ago

Advertisement
October 15, 2019, 09:23:52 am

Author Topic: [RELEASE] Admin System  (Read 43898 times)

misterff1

  • Donator
  • Hero Member
  • *****
  • Posts: 582
    • View Profile
Re: Admin System
« Reply #15 on: February 23, 2014, 08:08:36 pm »
Ah good, sorry must've missed that. Really can't wait to try this!

Castillo

  • Donator
  • Full Member
  • *****
  • Posts: 234
    • View Profile
Re: Admin System
« Reply #16 on: February 25, 2014, 05:18:58 am »
UPDATE:

Finished the ACL management tab.
Implemented commands system.

Preview: http://cubeupload.com/im/0OoEvo.jpg, http://cubeupload.com/im/mVcT11.jpg

I'm waiting for the next release to make the modules tab and for the text colour of tree nodes.

hashman80

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Admin System
« Reply #17 on: February 25, 2014, 11:34:29 am »
Insane! Great Work!

I think the basic Admin Prefix in the chat is included? Like
Quote
[Admin] User: lololol

Castillo

  • Donator
  • Full Member
  • *****
  • Posts: 234
    • View Profile
Re: Admin System
« Reply #18 on: February 25, 2014, 05:18:05 pm »
I could add an ACL permission which would allow you to enable the tag, displaying in which ACL you are.

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: Admin System
« Reply #19 on: February 25, 2014, 06:56:19 pm »
I could add an ACL permission which would allow you to enable the tag, displaying in which ACL you are.
That would be good. Also let us set the color of it in RGB?

Castillo

  • Donator
  • Full Member
  • *****
  • Posts: 234
    • View Profile
Re: Admin System
« Reply #20 on: February 25, 2014, 07:04:41 pm »
I can add colour when you create the ACL group, and maybe put there the tag itself, so if left blank, no tag displayed in chat, can be even more efficient than my previous idea I think.

Edit: Actually, I'm not entirely sure how is this gonna work, since a single player can be in multiple ACL groups at the same time, so how should it display the tag? imagine he's in 3 ACL groups: Admin, Manager and Owner, which tag should it display...?
« Last Edit: February 26, 2014, 01:35:12 am by Castillo »

misterff1

  • Donator
  • Hero Member
  • *****
  • Posts: 582
    • View Profile
Re: Admin System
« Reply #21 on: February 26, 2014, 08:15:59 am »
Owner ofcourse. Just use the highest rank that person has. Also is it possible to take over another player's movement? Not that it is required, but it would be fun at times.

Another thing: maybe you can use the beta branch so you can work on that getmodules() part already.

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: Admin System
« Reply #22 on: February 26, 2014, 08:25:23 am »
Edit: Actually, I'm not entirely sure how is this gonna work, since a single player can be in multiple ACL groups at the same time, so how should it display the tag? imagine he's in 3 ACL groups: Admin, Manager and Owner, which tag should it display...?
Give each ACL group a numerical rank, with the root group(Owner/Admin) always being 1. Subsequent groups are then auto-set by when in the list they're made.

Castillo

  • Donator
  • Full Member
  • *****
  • Posts: 234
    • View Profile
Re: Admin System
« Reply #23 on: February 26, 2014, 05:35:57 pm »
I don't know, it seems like I'll need to do a mess just to add a simple thing such as a tag, which is not required for what I had planned.

@misterff1: I don't know if they added it yet, and if they did, I don't know the function(s) name(s).
« Last Edit: February 26, 2014, 07:20:39 pm by Castillo »

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: Admin System
« Reply #24 on: February 26, 2014, 08:14:12 pm »
I don't know, it seems like I'll need to do a mess just to add a simple thing such as a tag, which is not required for what I had planned.

@misterff1: I don't know if they added it yet, and if they did, I don't know the function(s) name(s).
Then you don't need to add it in this release. After you release it I can look at the code and see about adding tags.

Castillo

  • Donator
  • Full Member
  • *****
  • Posts: 234
    • View Profile
Re: Admin System
« Reply #25 on: February 26, 2014, 09:33:23 pm »
Link to download the first version added!

Edit: If anyone has a suggestion, please post it. And remember to post any bugs you find here, so I can fix them as quickly as I can.
« Last Edit: February 26, 2014, 11:28:30 pm by Castillo »

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: Admin System
« Reply #26 on: February 27, 2014, 05:09:05 am »
Link to download the first version added!

Edit: If anyone has a suggestion, please post it. And remember to post any bugs you find here, so I can fix them as quickly as I can.
First impressions: Very cool.

Some things: When I gave another player admin rights it told me "JasonMRC has given you admin rights!" and the other player got no message but was made an admin.
Also, a player joined after I had loaded the module and I didn't see them in the list of players. In fact it seems to only show the players which were on when I first loaded it. Subsequent reloads do not show any more players.

Found the error relating to player's not being added to the list:
Code: [Select]
01:32:10 | [error] | Lua error in module AdminSystem when running event PlayerJoin: [string "class "Admin"..."]:434: attempt to index local 'args' (a nil value)
01:32:10 | [error] | Callstack:
01:32:10 | [error] |    self:addPlayerToList ( args.player ):434: in function <function Admin:onPlayerJoin ( args ):433>
It appears this is referring to the client/admin_client.lua file. I think this is wrong:
Code: [Select]
Events:Subscribe ( "PlayerJoin", self.onPlayerJoin )
Events:Subscribe ( "PlayerQuit", self.onPlayerQuit )
Shouldn't it be:
Code: [Select]
Events:Subscribe ( "PlayerJoin", self, self.onPlayerJoin )
Events:Subscribe ( "PlayerQuit", self, self.onPlayerQuit )
I tried editing it to that and it stopped giving the client error, but instead only the local player is added to the player list. I think these event subscribes and functions need to be in the server file instead of the client file.

Another thing, about 75% of the time when I reload your mod it crashes the game client for all admins.
« Last Edit: February 27, 2014, 07:40:43 am by JasonMRC »

WPK-Wolfseye

  • Full Member
  • ***
  • Posts: 209
    • View Profile
Re: [RELEASE] Admin System
« Reply #27 on: February 27, 2014, 04:25:53 pm »
Is it compatible with running ZED at the same time ?

Cheers

Wolfseye

Castillo

  • Donator
  • Full Member
  • *****
  • Posts: 234
    • View Profile
Re: [RELEASE] Admin System
« Reply #28 on: February 27, 2014, 04:28:43 pm »
About not adding players to list, it has to be that I forgot "self" in the event when I subscribed it, the rest should work, as it adds the local player just fine.

About the player not receving the message, I made a typo and sent the message to the admin as well ( oops )

And about the crashes... well, I had them when I was scripting it, but I really can't find what causes them, I tried removing part of the code and reloading it like 30 times in few seconds, but no crash, then when I kept working on it, it started crashing again, it was really strange.

@Wolfseye: None of my scripts use external modules, so I guess it doesn't.

Edit:

@Jason: You said that it only crashed the game for the admins? not for everyone in the server? also, download the script again, I've fixed the things you mentioned ( exept crashing ), I want to know if the player list is working fine now.
« Last Edit: February 27, 2014, 05:53:34 pm by Castillo »

JasonMRC

  • Donator
  • Hero Member
  • *****
  • Posts: 601
    • View Profile
Re: [RELEASE] Admin System
« Reply #29 on: February 27, 2014, 08:17:51 pm »
It adds players now whether the GUI is up or not. However it only removes them when the GUI is closed. Or rather, I had the GUI up, someone joined. They then left and the GUI was still up and it showed them in there. When I closed it and reopened it while they were still gone they weren't in the list.

With the crashes, (this is previously, before the update)I had the panel up and then reloaded it and I crashed. There were other players online but they didn't crash. I then tried it later with both I and another Admin on with the GUI up and reloaded it and it crashed for both of us. There were no other players on so not sure if it would've crashed for them.

Today after update I reloaded it with the GUI up and it crashed. I then tried reloading it with the GUI up and down and it didn't crash.

Most puzzling.