56 : server_id(0), join_req_time(0)
58 Print(
"Constructing NetGameClient\n");
74 if (server_name.
length() && port > 0) {
75 Print(
" '%s' is a client of '%s'\n", me.
Name(), server_name.
data());
81 Print(
" '%s' invalid game port number %d\n", me.
Name(), port);
84 Print(
" '%s' is a client without a server\n", me.
Name());
107 Print(
" sending join request - name: '%s' elem: '%s' index: %d\n",
134 Print(
"Client received Join Request from '%s'\n", join_req.
GetName());
150 DWORD nid = msg->
NetID();
163 strcpy_s(ship_name,
Game::GetText(
"NetGameClient.no-ship").data());
175 if (rgn && region != rgn->
Name()) {
194 sprintf_s(ship_name,
"%s %d", elem_name.
data(), index);
196 sprintf_s(ship_name,
"%s", elem_name.
data());
202 ship = element->
GetShip(index);
205 Print(
"NetGameClient::DoJoinAnnounce() could not find elem %s for player '%s' objid %d\n",
206 elem_name.
data(), name.
data(), oid);
217 strcpy_s(ship_name, ship->
Name());
220 if (rgn && region != rgn->Name()) {
239 if (name ==
"Server A.I. Ship") {
240 Print(
"Remote Player '%s' has joined as '%s' with ID %d\n", name.
data(), ship_name, oid);
257 bool finished =
false;
278 strcpy_s(ship_name,
Game::GetText(
"NetGameClient.no-ship").data());
287 sprintf_s(ship_name,
"%s %d", elem_name.
data(), index);
289 sprintf_s(ship_name,
"%s", elem_name.
data());
295 ship = element->
GetShip(index);
299 strcpy_s(ship_name, ship->
Name());
302 if (rgn && region != rgn->Name()) {
322 if (name ==
"Server A.I. Ship") {
323 Print(
"NetGameClient::DoJoinBacklog() Remote Player '%s' has joined as '%s' with ID %d\n", name.
data(), ship_name, oid);
341 Print(
"Client received Quit Request from NetID: %08X\n", msg->
NetID());
421 const Ship* owner = 0;
422 const char* owner_name =
"[NET]";
428 owner = shot->
Owner();
429 owner_name = owner->
Name();
440 const ShipDesign* owner_design = owner->Design();
441 if (owner_design && owner_design->
scale < scale)
442 scale = (float) owner_design->
scale;
455 else if (shot->
Damage() > 0)
480 killer_name = killer->
Name();
551 ::Print(
"NetGameClient::DoObjKill destroying shot '%s'\n", shot->
Name());
566 Print(
"Client received OBJ HYPER from NetID: %08x\n", msg->
NetID());
572 if (player && player->
GetShip())
613 if (player && player->
GetShip())
626 if (player && player->
GetShip())
640 const char* elem_name = elem_create.
GetName().
data();
642 ::Print(
"NetGameClient::DoElemCreate name: %s iff: %d type %s\n",
650 ::Print(
" element '%' already exists - ignored\n", elem_name);
659 int* slots = elem_create.
GetSlots();
663 bool alert = elem_create.
GetAlert();
684 for (
int i = 0; i < 4; i++) {
709 for (
int i = 0; i < 4; i++) {
712 hangar->
GotoAlert(squadron, slot, deck, elem, load, !alert);
730 int slot = ship_launch.
GetSlot();
738 hangar->
Launch(squadron, slot);
825 if (nav_data.
IsAdd()) {
830 if (index >= 0 && index < elem->GetFlightPlan().size())
841 if (navpt && index >= 0 && index < elem->GetFlightPlan().size()) {
868 else if (index < elem->FlightPlanLength()) {
886 ::
Print(
"NetGameClient::DoWepDestroy shot '%s'\n", shot->
Name());
967 BYTE* obj_loc_data = obj_loc.
Pack();
982 BYTE* data = net_data->
Pack();
985 if (net_data->
Type() >= 0x10)
1011 else if (server_peer) {
1047 return "NetGameClient";
1055 if (!oid || !spawn)
return;
1057 Print(
"NetGameClient::Respawn(%d, %s)\n", oid, spawn->
Name());
1066 Print(
" RESPAWN LOCAL PLAYER\n\n");