How to display an identical window to all players ?

Discuss the Dedicated Server Tools developed by Nadeo Live such as ManiaLive, Trust Circles, Dedicated Manager, Competition Manager and Lobbies

Moderator: NADEO

Fadden
Posts: 181
Joined: 10 May 2011, 18:21

How to display an identical window to all players ?

Post by Fadden »

Hi,

I want to display an identical window to all players.
I know it's possible to do that :

Code: Select all

foreach ($this->storage->players as $login => $player) 
{
  $window = MyWindow::Create($login);
  $window->show();
}
But this will be recalculate the window for all players, despite the window is not depending of the player... so a lot of unnecessary calculations will be done again.
How I can do, please ?
Elle est où la poulette ?
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: How to display an identical window to all players ?

Post by oliverde8 »

You can do it quite easily with

Code: Select all

$window = MyWindow::Create($login, false);
$window->show();
I don't know exactly what to pass in argument to replace $login. I pass Window::RECIPIENT_ALL and it seems to work. Need to do more testing :roflol:
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
The_Big_Boo
Posts: 1026
Joined: 15 Jun 2010, 15:46

Re: How to display an identical window to all players ?

Post by The_Big_Boo »

Indeed, you need to use Window::RECIPIENT_ALL ;)
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: How to display an identical window to all players ?

Post by oliverde8 »

The_Big_Boo wrote:Indeed, you need to use Window::RECIPIENT_ALL ;)
Thanks :thumbsup:
Do I need to make a ->show for new comers to see the widget or is it done automatically?
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
The_Big_Boo
Posts: 1026
Joined: 15 Jun 2010, 15:46

Re: How to display an identical window to all players ?

Post by The_Big_Boo »

Yes, you have to call show() for newcomers. You can even call show($login) with the login of the new player so it won't be sent again to every other players (if the window doesn't need to be refreshed for them).
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: How to display an identical window to all players ?

Post by oliverde8 »

The_Big_Boo wrote:Yes, you have to call show() for newcomers. You can even call show($login) with the login of the new player so it won't be sent again to every other players (if the window doesn't need to be refreshed for them).
this don't work well. Exemple :

ManiaLive starts I do

Code: Select all

show(Window::RECIPIENT_ALL)
Every one sees the Window, great until there.
Then player p2 connectes the game. I do

Code: Select all

show('p2') 
Great new player sees the window.
Now end Race I want to hide the window. I do

Code: Select all

hide(Window::RECIPIENT_ALL)
All windows but the one of p2 hides.

I suppose it is a Bug? I will recheck later today if I have time but I am sure this is what happened on a earlier test.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
The_Big_Boo
Posts: 1026
Joined: 15 Jun 2010, 15:46

Re: How to display an identical window to all players ?

Post by The_Big_Boo »

That's weird indeed... Anyway, I'm currently working on a new windowing system so it should be fixed when it'll be finished ^^
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: How to display an identical window to all players ?

Post by oliverde8 »

may I ask :oops: Will all windows we have coded need recoding?


(I am writing a note that I stick on my desk : If I am found dead in fron of my PC it is because The_Big_Boo from Nadeo pushed me to commit suicide.)We would need at least a good week to get over that at MLEPP. Supposing that text entry will also work.
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
The_Big_Boo
Posts: 1026
Joined: 15 Jun 2010, 15:46

Re: How to display an identical window to all players ?

Post by The_Big_Boo »

Maybe there will be some changes in the interface for plugin coders but not a lot. Anyway the windowing system really needs to be improved (and I can assure you it takes much more time on my side ^^).
OS: Win 7 Pro x64
RAM: 2x4GB Corsair @ 1600MHz
CPU: Intel i5 760 @ 3.6GHz
Mobo: Asus P7P55D-E
GPU: NVidia GTX 760 2GB
HDD: WD Black 1TB
Sound: VIA VT1828S (onboard)
Peripherals: Razer DeathAdder - Razer DeathStalker - Logitech F310
Fadden
Posts: 181
Joined: 10 May 2011, 18:21

Re: How to display an identical window to all players ?

Post by Fadden »

The_Big_Boo wrote:Indeed, you need to use Window::RECIPIENT_ALL ;)
Thanks, I found it a few days ago ;)
I use it but I didn't noticed this bug.
Elle est où la poulette ?
Post Reply

Return to “Dedicated Server Tools”

Who is online

Users browsing this forum: No registered users and 0 guests