Users isolation on hub
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Users isolation on hub

Started by WAJIM, 02 January, 2010, 20:43:57

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WAJIM

Quote from: PPK on 02 January, 2010, 19:49:50
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.

bastya_elvtars

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.
Everything could have been anything else and it would have just as much meaning.

WAJIM

#2
Quote from: bastya_elvtars on 02 January, 2010, 21:59:49
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)

bastya_elvtars

But one usually does not loop through the online users' table for this but instead a table is created like:
{ ["nick1"]=1, ["nick2"]=1 }
etc. then a simple
if usertable[user.sNick] then block_chat() end
will suffice.
Everything could have been anything else and it would have just as much meaning.

Thor

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.

WAJIM

Quote from: bastya_elvtars on 03 January, 2010, 11:33:28
But one usually does not loop through the online users' table for this but instead a table is created like:
{ ["nick1"]=1, ["nick2"]=1 }
etc. then a simple
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.

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?

WAJIM

Quote from: Thor on 03 January, 2010, 11:45:02
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.

PPK

Quote from: WAJIM on 03 January, 2010, 12:45:27
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.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

bastya_elvtars

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:
{"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.
Everything could have been anything else and it would have just as much meaning.

WAJIM

Quote from: PPK on 03 January, 2010, 14:15:32
Then run second hub and redirect them to that hub :P
Very inconveniently and not in all clients the redirection enabled.

QuoteBtw 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?  ::)

WAJIM

Quote from: bastya_elvtars on 03 January, 2010, 14:36:24
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:
{"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.  :-\

QuoteNevertheless, 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.

PPK

Quote from: WAJIM on 03 January, 2010, 14:40:45
Very inconveniently
Same as your isolation thing.
Quote from: WAJIM on 03 January, 2010, 14:40:45
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 ::)
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

bastya_elvtars

I think this would be easier with registration, that's the most convenient and resource-friendly way.
Everything could have been anything else and it would have just as much meaning.

WAJIM

Quote from: PPK on 03 January, 2010, 15:18:49
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.

SMF spam blocked by CleanTalk