Multiplayer GNet messages to all players

BlitzMax Forums/BlitzMax Programming/Multiplayer GNet messages to all players

Arska(Posted 2013) [#1]
Long time no posting here. :D

So does anyone know how to make GNetMessage to all remote objects. In my project there is some problems when trying to send messages to other players when sending message, picking item etc... When 2 players connected all works great, but when third one joins in problems begins.

So when player 1 sends message, only player 2 will get it, but when player 2 sends message player 3 gets that but not player 1.

I tried to make messages to be saved by server and server sends it to others, but server won't get messages all the time if even 2 players are joined. 1 player can easily send messages to server.

I tried to send GNet message as many times as there is players on server, but it didn't help.

So is there way to send message to all players at once? If yes... how?

Thanks!


Arska(Posted 2013) [#2]
And again i post too early.. I found solution. I'll post it here too.

For Local remoteObj1:TGNetObject=EachIn GNetObjects( host )
  Local chatm:TGNetObject = CreateGNetMessage:TGNetObject( host )
  SetGNetString chatm, SLOT_TYPE, "chat"
  SetGNetString chatm, SLOT_MSG, nickname+": "+text$+tempText$
		
  SendGNetMessage(chatm, remoteObj1)
Next


Just addes first and list line of that code and now all players receive messages.


Hardcoal(Posted 2013) [#3]
Thanks, it helps. Since nobody really bothers to answer GNet Questions..