getBuffer(); }; ConsoleMet"> Type Problem | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Type Problem

by Dallin Wellington · in Torque Game Engine · 10/22/2007 (8:18 pm) · 0 replies

Ok, so im trying to make my own UDP Socket class, and ive run into a problem here:

//ConsoleMethod: getBuffer()
ConsoleMethod(ByteBuffer, getBuffer,const char*, 2, 2, "getBuffer()")
{
	return (const char*)object->getBuffer();
};

ConsoleMethod(SWGNet,UDPSend,void,4,4,"UDPSend(char*,unsigned int)")
{
	object->UDPSend((char*)argv[2],dAtoi(argv[3]));

};

What i need is some way to keep the information i get from getBuffer() as a char*, but sence torque works with const char* for some reason its screwing up the char array when i try to insert it into UDPSend....


Here is my script code...

%SWGNetwork.UDPSend(%SessionRequest.getBuffer(),%SessionRequest.getSize());