GL - connect to server, need right IP
This commit is contained in:
parent
fa1473455f
commit
b60166a6e8
|
@ -31,40 +31,38 @@ namespace DanBias
|
|||
{
|
||||
|
||||
int pType = p[0].value.netInt;
|
||||
Client::GameClientState::ProtocolStruct* protocol;
|
||||
Client::GameClientState::ProtocolStruct* protocolData;
|
||||
switch (pType)
|
||||
{
|
||||
case protocol_PlayerNavigation:
|
||||
|
||||
break;
|
||||
case protocol_PlayerPosition:
|
||||
protocol = new Client::GameClientState::PlayerPos;
|
||||
protocolData = new Client::GameClientState::PlayerPos;
|
||||
for(int i = 0; i< 3; i++)
|
||||
{
|
||||
((Client::GameClientState::PlayerPos*)protocol)->playerPos[i] = p[i].value.netFloat;
|
||||
((Client::GameClientState::PlayerPos*)protocolData)->playerPos[i] = p[i].value.netFloat;
|
||||
}
|
||||
gameClientState->Protocol(protocol);
|
||||
delete protocol;
|
||||
protocol = NULL;
|
||||
gameClientState->Protocol(protocolData);
|
||||
delete protocolData;
|
||||
protocolData = NULL;
|
||||
break;
|
||||
|
||||
|
||||
case protocol_ObjectPosition:
|
||||
protocol = new Client::GameClientState::ObjPos;
|
||||
protocolData = new Client::GameClientState::ObjPos;
|
||||
for(int i = 0; i< 16; i++)
|
||||
{
|
||||
((Client::GameClientState::ObjPos*)protocol)->worldPos[i] = p[i].value.netFloat;
|
||||
((Client::GameClientState::ObjPos*)protocolData)->worldPos[i] = p[i].value.netFloat;
|
||||
}
|
||||
gameClientState->Protocol(protocol);
|
||||
delete protocol;
|
||||
protocol = NULL;
|
||||
gameClientState->Protocol(protocolData);
|
||||
delete protocolData;
|
||||
protocolData = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
class DanBiasGamePrivateData
|
||||
|
@ -114,6 +112,12 @@ namespace DanBias
|
|||
|
||||
m_data->r = new MyRecieverObject;
|
||||
m_data->r->nwClient = new Oyster::Network::NetworkClient();
|
||||
m_data->r->nwClient->Connect(desc.port, desc.IP);
|
||||
if (!m_data->r->nwClient->IsConnected())
|
||||
{
|
||||
// failed to connect
|
||||
return DanBiasClientReturn_Error;
|
||||
}
|
||||
// Start in lobby state
|
||||
m_data->gameClientState = new Client::LobbyState();
|
||||
m_data->gameClientState->Init(m_data->r->nwClient);
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace DanBias
|
|||
{
|
||||
//Stuff goes here...
|
||||
int port;
|
||||
const char* IP;
|
||||
HINSTANCE hinst;
|
||||
int nCmdShow;
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh
|
|||
// Game client starter code goes here
|
||||
DanBias::DanBiasGameDesc gameDesc;
|
||||
gameDesc.port = 1;
|
||||
gameDesc.IP = "10.1010.303";
|
||||
gameDesc.hinst = hinst;
|
||||
gameDesc.nCmdShow = cmdShow;
|
||||
|
||||
|
|
Loading…
Reference in New Issue