Sign in to follow this  
  • entries
    32
  • comments
    30
  • views
    10759

Progress.

Sign in to follow this  
Lacutis

117 views

Well, I've got the communication working both ways now.

Server:

E:\Development\Dev-Cpp\Projects\gtwserv>gtwserv
Loading EntityId
MySQLWrap::Connecting.
MySQLWrap::Connected.
MySQLWrap::Opening(SELECT * FROM EntityId WHERE Type = 'Player')
MySQLWrap::Open.
MySQLWrap::Field(0) = Type
MySQLWrap::Field(1) = CurrentValue
MySQLWrap::Close()
Call second Initialize()
Setting Connection.
Initializing Connection.
OnEnter()
Buffer : 0 Bytes.
Buffered 4 Bytes.
OnEnter() Finished. Buffered: 4
Buffered Byes: 4
Have 4 Bytes to send.
Sent 4 Bytes. 0 bytes remain.
1 sockets have activity.
Data to recieve!!
Recieved 4 bytes.
Translating 4 bytes.
Buffer currently has 0 bytes.
Need at least 4 bytes.
Not enough data, buffered 1 bytes.
Not enough data, buffered 2 bytes.
Not enough data, buffered 3 bytes.
Got COM_Hello in Handle()
1 sockets have activity.
Data to recieve!!
OnHungup()
OnLeave()
Saving EntityId
MySQLWrap::Connecting.
MySQLWrap::Connected.
MySQLWrap::Opening(UPDATE EntityId Set CurrentValue = 17)
MySQLWrap::Open.

E:\Development\Dev-Cpp\Projects\gtwserv>





Client:

NetObj = 1245
NetObj Var = 42
Recieved ComHello From Server, Sending Response.
Buffered 4 Bytes.
Sent 4 Bytes.





The source for the client (TorqueScript) looks like this now:

in setupT2DScene() :

$TestObj = new NetObj(testobj);
echo("NetObj = " @ $TestObj);
$TestObj.setVariable(42);
echo("NetObj Var = " @ $TestObj.getVariable());
$TestObj.Receive();
------------------------------------------------------
function TestObj::onHello()
{
echo("Recieved ComHello From Server, Sending Response.");
echo("Buffered " @ $TestObj.BufferData("ComHello") @ " Bytes.");
echo("Sent " @ $TestObj.SendBuffer() @ " Bytes.");
}




I can't really test spawning entities from the server yet as I am at work and vnc and graphical games don't really go hand in hand. So Ill continue with that after work.

As an aside, do I have the most boring Journal on gamedev or what? It's interesting to see what does and what doesn't get replies in Journalland.

Edit:
ComDisplay also seems to work without any changes:

OnEnter() Finished. Buffered: 4
Buffered Byes: 4
Have 4 Bytes to send.
Sent 4 Bytes. 0 bytes remain.
1 sockets have activity.
Data to recieve!!
Recieved 136 bytes.
Translating 136 bytes.
Buffer currently has 0 bytes.
Need at least 4 bytes.
Not enough data, buffered 1 bytes.
Not enough data, buffered 2 bytes.
Not enough data, buffered 3 bytes.
Got COM_Hello in Handle()
Not enough data, buffered 1 bytes.
Not enough data, buffered 2 bytes.
Not enough data, buffered 3 bytes.
Got COM_DISPLAY in Handle()
Message : Testing 1 2 3...
1 sockets have activity.
Data to recieve!!
OnHungup()
OnLeave()



From Torque2d:

function TestObj::onHello()
{
echo("Recieved ComHello From Server, Sending Response.");
echo("Buffered " @ $TestObj.BufferData("ComHello") @ " Bytes.");
echo("Sent " @ $TestObj.SendBuffer() @ " Bytes.");
echo("Sending Display Message : \"Testing 1 2 3...\"");
echo("Buffered " @ $TestObj.BufferData("ComDisplay", "Testing 1 2 3...") @ " Bytes.");
echo("Sent " @ $TestObj.SendBuffer() @ " Bytes.");
}


Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now