Making PlayerList with NetEvent.
by HoSung,Kim · in Torque Game Engine · 08/16/2006 (2:41 am) · 7 replies
I want PlayerList Packet with NetEvent.
but PlayerList is variable.
my PlayerList protocol like this.
TNL::U32 serialNum ;
string uid ;
protocol strucrue like this:
playerCnt serialNum uid
if playerNum == 1
1 12345 test01
if playerNum == 2
2 12345 test01 12346 test02
How can I make PlayerList like above ?
but PlayerList is variable.
my PlayerList protocol like this.
TNL::U32 serialNum ;
string uid ;
protocol strucrue like this:
playerCnt serialNum uid
if playerNum == 1
1 12345 test01
if playerNum == 2
2 12345 test01 12346 test02
How can I make PlayerList like above ?
#2
1. You could use a NetObject for each player, and "ghost" them to the client connections.
2. You could use RPC calls (one to add a new player to the list, one to remove a player from the list)
Either may be less work in the end.
I had trouble getting Ghosting to work, myself, but now I have it working fine.
I am going to make another post with some details.
tone
08/16/2006 (9:04 am)
HoSung... two other choices:1. You could use a NetObject for each player, and "ghost" them to the client connections.
2. You could use RPC calls (one to add a new player to the list, one to remove a player from the list)
Either may be less work in the end.
I had trouble getting Ghosting to work, myself, but now I have it working fine.
I am going to make another post with some details.
tone
#3
It's always good answers.
Thank you very much.
I'll try those method, report my result.
thank you again.
08/16/2006 (2:17 pm)
Ahaaaa, ok.It's always good answers.
Thank you very much.
I'll try those method, report my result.
thank you again.
#4
08/16/2006 (2:29 pm)
How do I send TNL::Vector ?
#5
http://opentnl.sourceforge.net/doxytree/rpcdesc.html
tone
08/17/2006 (8:14 am)
Apparently, you can sent them as parameters through RPCs:http://opentnl.sourceforge.net/doxytree/rpcdesc.html
tone
#6
08/17/2006 (10:50 am)
An example RPC implementation copied directly from my code. I am sending a vector of strings:TNL_IMPLEMENT_RPC(networkConnection, rpcOnJoinServerToClient,
(TNL::StringPtr ownerID, TNL::Vector<TNL::StringPtr> deviceNames),
(ownerID, deviceNames), TNL::NetClassGroupGameMask,
TNL::RPCGuaranteed, TNL::RPCDirServerToClient, 0)
Torque Owner Shyam "Doggan" Guthikonda