From 0da933a0146a0689546b21231e14f2dfc2bc14e8 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 23 Feb 2022 23:36:37 +0100 Subject: Switched to use ContentBundle's GetText --- Stars45/NetGameServer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Stars45/NetGameServer.cpp') diff --git a/Stars45/NetGameServer.cpp b/Stars45/NetGameServer.cpp index 10ab73d..76bd4ff 100644 --- a/Stars45/NetGameServer.cpp +++ b/Stars45/NetGameServer.cpp @@ -40,6 +40,7 @@ #include "NetPeer.h" #include "NetUtil.h" #include "Game.h" +#include "ContentBundle.h" #include "Light.h" // +--------------------------------------------------------------------+ @@ -171,7 +172,7 @@ NetGameServer::CheckSessions() if (peer && (NetLayer::GetUTC() - peer->LastReceiveTime()) > NET_DISCONNECT_TIME) { // announce drop: NetPlayer* zombie = iter.removeItem(); - HUDView::Message(Game::GetInstance()->GetText("NetGameServer.remote-discon").data(), zombie->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer.remote-discon").data(), zombie->Name()); // tell everyone else: NetQuitAnnounce quit_ann; @@ -222,7 +223,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg) NetJoinRequest join_req; if (join_req.Unpack(msg->Data())) { - HUDView::Message(Game::GetInstance()->GetText("NetGameServer::join-request").data(), join_req.GetName(), join_req.GetElement(), join_req.GetIndex()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer::join-request").data(), join_req.GetName(), join_req.GetElement(), join_req.GetIndex()); DWORD nid = msg->NetID(); Text name = join_req.GetName(); @@ -286,7 +287,7 @@ NetGameServer::DoJoinRequest(NetMsg* msg) remote_player->SetObjID(ship->GetObjID()); remote_player->SetShip(ship); - HUDView::Message(Game::GetInstance()->GetText("NetGameServer::join-announce").data()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer::join-announce").data()); Print("remote player name = %s\n", name.data()); Print(" obj = %d\n", ship->GetObjID()); Print(" ship = %s\n", ship->Name()); @@ -372,7 +373,7 @@ NetGameServer::DoQuitRequest(NetMsg* msg) if (player) { NetPlayer* zombie = players.remove(player); - HUDView::Message(Game::GetInstance()->GetText("NetGameServer.remote-quit").data(), zombie->Name()); + HUDView::Message(ContentBundle::GetInstance()->GetText("NetGameServer.remote-quit").data(), zombie->Name()); // tell everyone else: NetQuitAnnounce quit_ann; @@ -465,7 +466,7 @@ NetGameServer::DoObjKill(NetMsg* msg) Ship* ship = FindShipByObjID(obj_kill.GetObjID()); if (ship) { Ship* killer = FindShipByObjID(obj_kill.GetKillerID()); - Text killer_name = Game::GetInstance()->GetText("NetGameServer.unknown"); + Text killer_name = ContentBundle::GetInstance()->GetText("NetGameServer.unknown"); if (killer) killer_name = killer->Name(); @@ -909,7 +910,7 @@ NetGameServer::RouteChatMsg(NetChatMsg& chat_msg) if (local_player && (dst_id == 0xffff || dst_id == 0 || local_player->GetIFF() == (int) dst_id-1)) { Text name = chat_msg.GetName(); if (name.length() < 1) - name = Game::GetInstance()->GetText("NetGameServer.chat.unknown"); + name = ContentBundle::GetInstance()->GetText("NetGameServer.chat.unknown"); // don't echo general messages from the local player. // they are already displayed by the chat entry code @@ -924,7 +925,7 @@ NetGameServer::RouteChatMsg(NetChatMsg& chat_msg) else if (local_player && local_player->GetObjID() == dst_id) { Text name = chat_msg.GetName(); if (name.length() < 1) - name = Game::GetInstance()->GetText("NetGameServer.chat.unknown"); + name = ContentBundle::GetInstance()->GetText("NetGameServer.chat.unknown"); HUDView::Message("%s> %s", name.data(), chat_msg.GetText().data()); } -- cgit v1.1