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;
|
int pType = p[0].value.netInt;
|
||||||
Client::GameClientState::ProtocolStruct* protocol;
|
Client::GameClientState::ProtocolStruct* protocolData;
|
||||||
switch (pType)
|
switch (pType)
|
||||||
{
|
{
|
||||||
case protocol_PlayerNavigation:
|
case protocol_PlayerNavigation:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case protocol_PlayerPosition:
|
case protocol_PlayerPosition:
|
||||||
protocol = new Client::GameClientState::PlayerPos;
|
protocolData = new Client::GameClientState::PlayerPos;
|
||||||
for(int i = 0; i< 3; i++)
|
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);
|
gameClientState->Protocol(protocolData);
|
||||||
delete protocol;
|
delete protocolData;
|
||||||
protocol = NULL;
|
protocolData = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case protocol_ObjectPosition:
|
case protocol_ObjectPosition:
|
||||||
protocol = new Client::GameClientState::ObjPos;
|
protocolData = new Client::GameClientState::ObjPos;
|
||||||
for(int i = 0; i< 16; i++)
|
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);
|
gameClientState->Protocol(protocolData);
|
||||||
delete protocol;
|
delete protocolData;
|
||||||
protocol = NULL;
|
protocolData = NULL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
class DanBiasGamePrivateData
|
class DanBiasGamePrivateData
|
||||||
|
@ -114,6 +112,12 @@ namespace DanBias
|
||||||
|
|
||||||
m_data->r = new MyRecieverObject;
|
m_data->r = new MyRecieverObject;
|
||||||
m_data->r->nwClient = new Oyster::Network::NetworkClient();
|
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
|
// Start in lobby state
|
||||||
m_data->gameClientState = new Client::LobbyState();
|
m_data->gameClientState = new Client::LobbyState();
|
||||||
m_data->gameClientState->Init(m_data->r->nwClient);
|
m_data->gameClientState->Init(m_data->r->nwClient);
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace DanBias
|
||||||
{
|
{
|
||||||
//Stuff goes here...
|
//Stuff goes here...
|
||||||
int port;
|
int port;
|
||||||
|
const char* IP;
|
||||||
HINSTANCE hinst;
|
HINSTANCE hinst;
|
||||||
int nCmdShow;
|
int nCmdShow;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ int WINAPI WinMain( HINSTANCE hinst, HINSTANCE prevInst, PSTR cmdLine, int cmdSh
|
||||||
// Game client starter code goes here
|
// Game client starter code goes here
|
||||||
DanBias::DanBiasGameDesc gameDesc;
|
DanBias::DanBiasGameDesc gameDesc;
|
||||||
gameDesc.port = 1;
|
gameDesc.port = 1;
|
||||||
|
gameDesc.IP = "10.1010.303";
|
||||||
gameDesc.hinst = hinst;
|
gameDesc.hinst = hinst;
|
||||||
gameDesc.nCmdShow = cmdShow;
|
gameDesc.nCmdShow = cmdShow;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue