determinate determinate

Author Topic: Users isolation on hub  (Read 1501 times)

0 Members and 1 Guest are viewing this topic.

Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Users isolation on hub
« on: January 02, 2010, 08:43:57 pm »
No, nobody reported that  ::)
I can't reproduce this crash now, maybe it because of a server's upgrade, now scripts restarts very fast...  :-\

1. Can you make event like ValidateNickRealArrival, that rises REALLY when "$ValidateNick Nick" arrivals, i.e. before hub process user's Nick for registration/duplication?

2. Can you make blockable broadcast actions, like Core.SetUser(tUser, attr, value) where attr == 1 - bBlockSearch, attr == 2 - bBlockSendToAll, 3 == bBlockSendPmToAll, 4 == bBlockChat?

If tUser.bBlockChat == true, user will never receives ChatArrival-messages from other users.
If tUser.bBlockSearch == true, user will never receives $Search commands from other users.
If tUser.bBlockSendToAll == true, user will never receives scripted SendToAll() data.
If tUser.bBlockSendPmToAll == true, user will never receives scripted SendPMToAll() data.

I think that its very faster than exceptable scripted broadcasts like "for _, i in ipairs(Core.GetOnlineUsers()) do ..... if i.sNick ~= user.sNick then Core.SendToUser(i....") in Chat/SearchArrival events.
« Last Edit: January 02, 2010, 08:46:51 pm by WAJIM »

Offline bastya_elvtars

  • Administrator
  • Forum God
  • *****
  • Posts: 3 795
  • Karma: +172/-7
  • The rock n' roll doctor
    • The LawMaker & FreshStuff3 Site
Users isolation on hub
« Reply #1 on: January 02, 2010, 09:59:49 pm »
So what is the sense of not receiving $Search and chat and other things? In my ~7 years of DC experience this has never been required.

Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Users isolation on hub
« Reply #2 on: January 02, 2010, 10:11:37 pm »
So what is the sense of not receiving $Search and chat and other things? In my ~7 years of DC experience this has never been required.
1. Fast Main Chat Blocking for some users (Option)
2. Fast Search Blocking for some users (ShareReq Rules for example)
« Last Edit: January 02, 2010, 10:24:31 pm by WAJIM »

Offline bastya_elvtars

  • Administrator
  • Forum God
  • *****
  • Posts: 3 795
  • Karma: +172/-7
  • The rock n' roll doctor
    • The LawMaker & FreshStuff3 Site
Users isolation on hub
« Reply #3 on: January 03, 2010, 11:33:28 am »
But one usually does not loop through the online users' table for this but instead a table is created like:
Code: [Select]
{ ["nick1"]=1, ["nick2"]=1 } etc. then a simple
Code: [Select]
if usertable[user.sNick] then block_chat() end will suffice.

Offline Thor

  • Scripter
  • Lord
  • ******
  • Posts: 296
  • Karma: +43/-5
    • Hungarian Direct Connect Site
Users isolation on hub
« Reply #4 on: January 03, 2010, 11:45:02 am »
I share WAJIM's point, because you can use block_chat(), which eg. is a ChatArrival, which will does the hub's job: in a for loop, sends the messages for the allowed users. But what's with the other scripts? Core.SendToAll() will still send them the messages. The hungarian hubsoftware had the option to turn off the chat messages after x minutes inactivation. And the Lua API had SendToMcOn call to send message to users whose chat is on. I think WAJIM meant that.
May the force be with you



Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Users isolation on hub
« Reply #5 on: January 03, 2010, 12:22:07 pm »
But one usually does not loop through the online users' table for this but instead a table is created like:
Code: [Select]
{ ["nick1"]=1, ["nick2"]=1 } etc. then a simple
Code: [Select]
if usertable[user.sNick] then block_chat() end will suffice.

In that case it is necessary to rewrite all broadcast events (ChatArrival/SearchArrival) and functions (SendToAll/SendPmToAll) for pass through script. When online users > ~4000, it can really load CPU.

Code: [Select]
function SearchArrival(user, data)
    local i, u_nick, i_nick
u_nick = user.sNick
for _, i in ipairs(Core.GetOnlineUsers()) do
    i_nick = i.sNick
    if not tBlockSearch[i_nick] and i_nick ~= u_nick then Core.SendToUser(i, data) end
end
return true
end

Think this code it is optimum?

Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Users isolation on hub
« Reply #6 on: January 03, 2010, 12:45:27 pm »
The hungarian hubsoftware had the option to turn off the chat messages after x minutes inactivation. And the Lua API had SendToMcOn call to send message to users whose chat is on.
It can be realized easily on PtokaX after realization of my offers.  ;)

It is necessary for me to isolate some users form other users.
I am not able to do it optimum with current API.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 245
  • Karma: +206/-17
  • PtokaX "developer"
Users isolation on hub
« Reply #7 on: January 03, 2010, 02:15:32 pm »
It is necessary for me to isolate some users form other users.
Then run second hub and redirect them to that hub :P

Btw this is not feature request part of board, any request here are ignored.

Offline bastya_elvtars

  • Administrator
  • Forum God
  • *****
  • Posts: 3 795
  • Karma: +172/-7
  • The rock n' roll doctor
    • The LawMaker & FreshStuff3 Site
Users isolation on hub
« Reply #8 on: January 03, 2010, 02:36:24 pm »
OK, I see that you want to disallow users from _receiving_ such things like mainchat messages and $Search requests. This would be done easier is SendToAll had an additional parameter that is an array:
Code: [Select]
{"joe", "brian", "pilate", "centurion"} which will not send the particular protocol message to other users. Nevertheless, I still do not get what the practical use could be.

Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Users isolation on hub
« Reply #9 on: January 03, 2010, 02:40:45 pm »
Then run second hub and redirect them to that hub :P
Very inconveniently and not in all clients the redirection enabled.

Quote
Btw this is not feature request part of board, any request here are ignored.
Whether is easier to tell, that you do not wish anything to change?  ::)

Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Users isolation on hub
« Reply #10 on: January 03, 2010, 02:52:48 pm »
OK, I see that you want to disallow users from _receiving_ such things like mainchat messages and $Search requests. This would be done easier is SendToAll had an additional parameter that is an array:
Code: [Select]
{"joe", "brian", "pilate", "centurion"} which will not send the particular protocol message to other users.
Possible realization, but using of the table every function call will be slower, then hub's native table.
Besides it is necessary to synchronize this table between all scripts.  :-\

Quote
Nevertheless, I still do not get what the practical use could be.
I want to make acknowledgement of bans on my hub. While the user will not confirm, that he was banned sometime, it cannot download/search and at it nobody can download/search form them.

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 245
  • Karma: +206/-17
  • PtokaX "developer"
Re: Users isolation on hub
« Reply #11 on: January 03, 2010, 03:18:49 pm »
Very inconveniently
Same as your isolation thing.
Whether is easier to tell, that you do not wish anything to change?  ::)
You can do your isolation thing with script, imho it is stupid so it will not be implemented in PtokaX.

Topic splitted and moved to Feature proposals ::)

Offline bastya_elvtars

  • Administrator
  • Forum God
  • *****
  • Posts: 3 795
  • Karma: +172/-7
  • The rock n' roll doctor
    • The LawMaker & FreshStuff3 Site
Re: Users isolation on hub
« Reply #12 on: January 03, 2010, 03:58:28 pm »
I think this would be easier with registration, that's the most convenient and resource-friendly way.

Offline WAJIM

  • Member
  • ***
  • Posts: 41
  • Karma: +3/-5
Re: Users isolation on hub
« Reply #13 on: January 03, 2010, 04:11:09 pm »
You can do your isolation thing with script
I konw, but this script will consume much CPU and I have suggested to make API more flexible.

Offline Mutor

  • Global Moderator
  • Forum God
  • *****
  • Posts: 3 854
  • Karma: +395/-18
  • To err is human, to arr is pirate...
    • PxDev
Re: Users isolation on hub
« Reply #14 on: January 03, 2010, 04:33:09 pm »
Consider an additional profile for such users.
As all permission are assigned by user profile it seems the logical way to restrict such users.
No it will not help with respect to SendToAll but I doubt that this really matters in most cases.
You can still easily easily block chat and or search [or any other profile permission] so if you're
unwilling to adjust scripts to meet your need, I doubt it much matters if they receive messages
broadcast to all. It is also odd to me that you would even allow users in the hub that cannot
chat search or share into your hub.

In general anything that can be scripted well will NOT be added.
Your needs are specific and obscure to the vast majority of PtokaX users, on this point alone
you should expect that no such feature would be added.
Respectfully,

Mutor

=-=-=-=-=-=-=-==-=-=-=
[ Ptokax Admins Hub ] Ptokax Help Hub
[ Mutor's Ptokax Archive Website ] Scripting Forum
[ Dynamic Downloads ] API 2
[ Microsoft IIS serving PxWeb 1.0d ] API 2
[ WebReg 1.1.2.0 ] Web Based Hub Reg

 

determinate determinate