Game Development Community

can i send client information to server ?

by Enel · in Torque 3D Professional · 07/08/2010 (5:26 am) · 5 replies

packUpdate / unpackUpdate is just use send server object information to client

but how can i send changed client object information to server?

it is relate to writePacketData/readPacketData ?

if it is relate to writePacketData/readPacketData how can i send packet? like setMaskBits(mask)

#1
07/08/2010 (5:51 am)
Is “CommandToServer()” and “commandToClient()” what you’re after?

There is some infos here: tdn.garagegames.com/wiki/TorqueScript_Console_Functions_4
#2
07/08/2010 (9:24 am)
@Leon

no no.. my question is in Engine cpp Player information

is not in script
#3
07/08/2010 (2:18 pm)
Look at gameconnection, there is the code where the client send the move informations. I don't know what informations you want to send from client to server but maybe it's a good place to look ;) For other stuff like "client changed password", "client want to use item" or "client is afk no", I would use commandtoserver like leon said.
#4
07/08/2010 (9:14 pm)
@thomas

a ha :) thx thomas

i want to send from client to server meele weapon dummy(like muzzlePoint) inforamtion when player attack animation

animate information only know my client

so example

processtick of Projectile i want to move projectile to player muzzlepoint :)
if(mDataBlock->AttachMuzzlePoint){
	   
	   Point3F pos;
	   if ( mSourceObject.isValid() && isClientObject()) {
		   
		   mSourceObject->getMuzzlePoint(0, &pos); // here this

		   // i want to send pos information from client to server

		   newPosition = pos;
	   }
   }

i would see GameConnection :)

thx thomas

#5
07/09/2010 (2:11 am)
You could place the code in:
Client: GameConnection::writePacket
Server: GameConnection::readPacket

You may need to add mMuzzlePoint to gameconnection class like it is done with mCameraPos and fill it somewhere to make it work.
I still use TGE and didn't check if this has changed in T3D but I guess it's basically the same.