Newbie Spellweaver
- Joined
- Nov 27, 2017
- Messages
- 51
- Reaction score
- 79
Hello friends, I will share a system that I created for a long time for everyone. May be old or new, for some people it was stolen from my sister server and then sold it I don't like people selling it. I share my code To welcome the new year And to face those people That brought it to sell.
I don't share FLA just because I want everyone to participate in this part. Good luck, friends.
<-Client->----------------------------------------
HUDDisplay.h
----------------------------------------
Find
Placed below
Find
Replace
Find
Placed below
Find
Placed below
----------------------------------------
HUDDisplay.cpp
----------------------------------------
Find
Placed below
Find
Placed below
Find
Placed below
Find
Placed below
Find
Placed below
Find
Placed below
----------------------------------------
HUDPause.cpp
----------------------------------------
Find
Placed below
----------------------------------------
P2PMessages.h
----------------------------------------
Find
Placed below
Find
Placed below
----------------------------------------
HUD_TPSGame.cpp
----------------------------------------
Find
Replace
----------------------------------------
FrontEndWarZ.cpp
----------------------------------------
Find
Put on top
----------------------------------------
WeaponConfig.h
----------------------------------------
Find
Placed below
----------------------------------------
AI_Player.CPP
----------------------------------------
Find
Placed below
Find
Replace
Find
Placed below
Find in DoDeath() Function
See
hudMain->hideSafelockPin();
Placed below
----------------------------------------
obj_ServerPlayer.h
----------------------------------------
Find
Placed below
Find
Placed below
Find
Placed below
<-END CLIENT->
<-SERVER->
----------------------------------------
obj_ServerPlayer.h
----------------------------------------
Find
Placed below
Find
Put on top
----------------------------------------
MasterServerLogic.h
----------------------------------------
Find
Placed below
Find
Placed below
----------------------------------------
MasterServerLogic.cpp
----------------------------------------
Find
Placed below
Find
Placed below
Find
Placed below
----------------------------------------
ServerGameLogic.h
----------------------------------------
Find
Placed below
Find
Placed below
----------------------------------------
ServerGameLogic.cpp
----------------------------------------
Find
Placed below
Find
Placed below
Find
Put on top
Find
Put on top
----------------------------------------
MasterGameServer.h
----------------------------------------
Find
Placed below
----------------------------------------
MasterGameServer.cpp
----------------------------------------
Find
Placed below
Find
Placed below
Find
Placed below
Find
Placed below
----------------------------------------
SupervisorGameServer.cpp
----------------------------------------
Find
Placed below
----------------------------------------
SupervisorServer.cpp
----------------------------------------
Find
Placed below
<-END SERVER->
//a sample
I don't share FLA just because I want everyone to participate in this part. Good luck, friends.
<-Client->----------------------------------------
HUDDisplay.h
----------------------------------------
Find
Code:
// notes
Placed below
Code:
bool canShowMegaphone() const { return r3dGetTime() > timeoutForMegaphone && r_render_in_game_HUD->GetBool(); }//NaraRZ
void showWriteMegaphone(int slotIDFrom);
void hideWriteMegaphone();
int MegaphoneColor;
void MegaPhoneMiniSystem(const char* text, int Color, const char* enable);
Find
Code:
bool isChatInputActive() const { return chatInputActive || (r3dGetTime()-lastChatMessageSent)<0.25f || writeNoteSavedSlotIDFrom || isSafelockPinVisible; }
Replace
Code:
bool isChatInputActive() const { return chatInputActive || (r3dGetTime()-lastChatMessageSent)<0.25f || writeNoteSavedSlotIDFrom || writeMegaphoneSavedSlotIDFrom || isSafelockPinVisible; }//NaraRZ
Find
Code:
void eventSafelockPass(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
Placed below
Code:
void eventWriteMegaPhoneMini(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
void eventMegaphoneClosed(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);//NaraRZ
void eventMegaphoneColor(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
Find
Code:
bool isWriteNoteVisible;
Placed below
Code:
bool isWriteMegaphoneVisible;//NaraRZ
int writeMegaphoneSavedSlotIDFrom;
float timeoutForMegaphone;
----------------------------------------
HUDDisplay.cpp
----------------------------------------
Find
Code:
, writeNoteSavedSlotIDFrom( 0 )
Placed below
Code:
, timeoutForMegaphone(0)//NaraRZ
, MegaphoneColor(0)
, isWriteMegaphoneVisible( false )
Find
Code:
gfxHUD.RegisterEventHandler("eventSafelockPass", MAKE_CALLBACK(eventSafelockPass));
Placed below
Code:
gfxHUD.RegisterEventHandler("eventWriteMegaPhoneMini", MAKE_CALLBACK(eventWriteMegaPhoneMini));//NaraRZ
gfxHUD.RegisterEventHandler("eventMegaphoneClosed", MAKE_CALLBACK(eventMegaphoneClosed));
gfxHUD.RegisterEventHandler("eventMegaphoneColor", MAKE_CALLBACK(eventMegaphoneColor));
Find
Code:
isWriteNoteVisible = false;
Placed below
Code:
isWriteMegaphoneVisible = false;//NaraRZ
Find
Code:
bool isUserDev = (flags&2)?true:false;
Placed below
Code:
bool isMegaphone = (flags & 3) ? true : false;//NaraRZ
Find
Code:
if(isUserDev)
{
userColor = "#ff0000";
textColor = "#ff0000";
namePrefix = "<GM>";
}
Placed below
Code:
if(isMegaphone)//NaraRZ
{
userColor = "#FFBB00";
textColor = "#B5B5B5";
}
Find
Code:
void HUDDisplay::removePlayerFromVoipList(const char* name)
{
if(!Inited) return;
gfxHUD.Invoke("_root.api.removePlayerFromVoipList", name);
}
Placed below
Code:
extern const char* getMegaphoneColor(int Color);//NaraRZ
void HUDDisplay::MegaPhoneMiniSystem(const char* text, int Color, const char* enable)
{
if (!Inited) return;
Scaleform::GFx::Value var[3];
var[0].SetString(text);
var[1].SetString(getMegaphoneColor(Color));
var[2].SetString(enable);
gfxHUD.Invoke("_root.api.showMegaphone", var, 3);
}
void HUDDisplay::showWriteMegaphone(int slotIDFrom)
{
if (!Inited) return;
if (isWriteMegaphoneVisible)
return;
r3dMouse::Show();
writeMegaphoneSavedSlotIDFrom = slotIDFrom;
Scaleform::GFx::Value var[1];
var[0].SetBoolean(true);
gfxHUD.Invoke("_root.api.showMegaphoneWrite", var, 1);
isWriteMegaphoneVisible = true;
}
void HUDDisplay::eventMegaphoneClosed(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
r3dMouse::Hide();
if (!Inited) return;
if (!isWriteMegaphoneVisible) return;
r3dMouse::Hide();
Scaleform::GFx::Value var[1];
var[0].SetBoolean(false);
gfxHUD.Invoke("_root.api.showMegaphoneWrite", var, 1);
timeoutForMegaphone = r3dGetTime() + .5f;
writeMegaphoneSavedSlotIDFrom = 0;
isWriteMegaphoneVisible = false;
}
void HUDDisplay::hideWriteMegaphone()
{
if (!Inited) return;
if (!isWriteMegaphoneVisible) return;
r3dMouse::Hide();
Scaleform::GFx::Value var[1];
var[0].SetBoolean(false);
gfxHUD.Invoke("_root.api.showMegaphoneWrite", var, 1);
isWriteMegaphoneVisible = false;
writeMegaphoneSavedSlotIDFrom = 0;
}
void HUDDisplay::eventMegaphoneColor(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)//NaraRZ
{
r3d_assert(argCount == 1);
int TextColor = args[0].GetInt();
MegaphoneColor = TextColor;
char ColorStr[1024];
sprintf(ColorStr, "%s", getMegaphoneColor(TextColor));
if (!Inited) return;
Scaleform::GFx::Value var[1];
var[0].SetString(ColorStr);
gfxHUD.Invoke("_root.api.Megaphone", var, 1);
//Or
//gfxHUD.Invoke("_root.api.Megaphone", ColorStr, 1);
}
void HUDDisplay::eventWriteMegaPhoneMini(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
{
r3d_assert(argCount == 1);
r3dMouse::Hide();
const char* Message = args[0].GetString();
r3dSTLString WriteNote(Message);
obj_Player* plr = gClientLogic().localPlayer_;
r3d_assert(plr);
PKT_C2S_MegaphoneMini_s n;
n.SlotFrom = (BYTE)writeMegaphoneSavedSlotIDFrom;
n.TextColor = MegaphoneColor;
r3dscpy(n.TextFrom, plr->CurLoadout.Gamertag);
r3dscpy(n.TextSubj, WriteNote.c_str());
p2pSendToHost(gClientLogic().localPlayer_, &n, sizeof(n));
// local logic
wiInventoryItem& wi = plr->CurLoadout.Items[writeMegaphoneSavedSlotIDFrom];
r3d_assert(wi.itemID && wi.quantity > 0);
//local logic
wi.quantity--;
if (wi.quantity <= 0) {
wi.Reset();
}
plr->OnBackpackChanged(writeMegaphoneSavedSlotIDFrom);
timeoutForMegaphone = r3dGetTime() + .5f;
writeMegaphoneSavedSlotIDFrom = 0;
isWriteMegaphoneVisible = false;
}
----------------------------------------
HUDPause.cpp
----------------------------------------
Find
Code:
if(wi.itemID == WeaponConfig::ITEMID_PieceOfPaper) // world note
{
if(hudMain->canShowWriteNote())
{
Deactivate();
hudMain->showWriteNote(slotID);
}
return;
}
Placed below
Code:
else if(wi.itemID == WeaponConfig::ITEMID_MegaphoneMiniItem)//NaraRZ // world note
{
if(hudMain->canShowMegaphone())
{
Deactivate();
hudMain->showWriteMegaphone(slotID);
}
return;
}
----------------------------------------
P2PMessages.h
----------------------------------------
Find
Code:
PKT_S2C_SpawnExplosion,
Placed below
Code:
PKT_C2S_MegaphoneMini,//NaraRZ
PKT_S2C_MegaphoneChat,
Find
Code:
struct PKT_C2C_ChatMessage_s : public DefaultPacketMixin<PKT_C2C_ChatMessage>
{
BYTE msgChannel; // 0-proximity, 1-global
BYTE userFlag; // 1-Legend
char gamertag[32*2];
char msg[128]; // actual text
};
Placed below
Code:
struct PKT_C2S_MegaphoneMini_s : public DefaultPacketMixin<PKT_C2S_MegaphoneMini>//NaraRZ
{
BYTE SlotFrom;
char TextFrom[128];
char TextSubj[1024];
int TextColor;
};
struct PKT_S2C_MegaphoneChat_s : public DefaultPacketMixin<PKT_S2C_MegaphoneChat>
{
char Username[128];
char Text[1024];
int TextColor;
};
----------------------------------------
HUD_TPSGame.cpp
----------------------------------------
Find
Code:
if(!win::bSuspended && hudMain->isChatInputActive())
{
bool escPressed = Keyboard->WasPressed(kbsEsc);
if(escPressed)
{
hudMain->hideGravestone();
hudMain->hideReadNote();
hudMain->hideWriteNote();
hudMain->hideSafelockPin();
}
}
Replace
Code:
if(!win::bSuspended && hudMain->isChatInputActive())
{
bool escPressed = Keyboard->WasPressed(kbsEsc);
if(escPressed)
{
hudMain->hideGravestone();
hudMain->hideReadNote();
hudMain->hideWriteNote();
hudMain->hideWriteMegaphone();//NaraRZ
hudMain->hideSafelockPin();
}
}
FrontEndWarZ.cpp
----------------------------------------
Find
Code:
const char* getMapName(int mapID)
Put on top
Code:
const char* getMegaphoneColor(int color)//NaraRZ
{
const char* TextColor = "000000"; //Default
if (color == 0)//White
TextColor = "E8E8E8";
else if (color == 1)//Blue
TextColor = "00AAFF";
else if (color == 2)//Red
TextColor = "FF0000";
else if (color == 3)//Grey
TextColor = "666666";
return TextColor;
}
----------------------------------------
WeaponConfig.h
----------------------------------------
Find
Code:
ITEMID_C04Vaccine = 101303,
Placed below
Code:
ITEMID_MegaphoneMiniItem = 111111,
----------------------------------------
AI_Player.CPP
----------------------------------------
Find
Code:
if(hudMain) hudMain->hideWriteNote(); //Cynthia: 1788
Placed below
Code:
if (hudMain) hudMain->hideWriteMegaphone();//NaraRZ
Find
Code:
if(hudMain && hudMain->isSafelockPinActive()){
if (hudMain)
{
hudMain->hideWriteNote();
}
r3dMouse::Show();
needExit = true;
}
Replace
Code:
if(hudMain && hudMain->isSafelockPinActive()){
if (hudMain)
{
hudMain->hideWriteNote();
hudMain->hideWriteMegaphone();//NaraRZ
}
r3dMouse::Show();
needExit = true;
}
Find
Code:
else if(wpn->getItemID() == WeaponConfig::ITEMID_PieceOfPaper)
{
m_isAiming = false;
m_isFinishedAiming = false;
if(InputMappingMngr->wasReleased(r3dInputMappingMngr::KS_PRIMARY_FIRE) || m_ItemSimulateLeftClick)
{
m_ItemSimulateLeftClick = false;
if(hudMain && hudMain->canShowWriteNote())
hudMain->showWriteNote(wpn->m_BackpackIdx);
}
}
Placed below
Code:
else if(wpn->getItemID() == WeaponConfig::ITEMID_MegaphoneMiniItem)//NaraRZ
{
m_isAiming = false;
m_isFinishedAiming = false;
if(InputMappingMngr->wasReleased(r3dInputMappingMngr::KS_PRIMARY_FIRE) || m_ItemSimulateLeftClick)
{
m_ItemSimulateLeftClick = false;
if(hudMain && hudMain->canShowMegaphone())
hudMain->showWriteMegaphone(wpn->m_BackpackIdx);
}
}
Find in DoDeath() Function
Code:
SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/MainMenu GUI/UI_player_death"), GetPosition());
hudMain->hideSafelockPin();
Placed below
Code:
hudMain->hideWriteMegaphone();//NaraRZ
----------------------------------------
obj_ServerPlayer.h
----------------------------------------
Find
Code:
DEFINE_PACKET_FUNC(PKT_S2C_UseNetObjectAns);
Placed below
Code:
DEFINE_PACKET_FUNC(PKT_S2C_MegaphoneChat);//NaraRZ
Find
Code:
IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_ShutdownNote)
{
gameShuttedDown_ = true;
char msg[128];
if(n.reason == 2)
sprintf(msg, gLangMngr.getString("ServerInstanceIsShuttingDown"), n.timeLeft);
else
sprintf(msg, gLangMngr.getString("ServerShuttingDown"), n.timeLeft);
if(hudMain)
{
hudMain->showChatNara(true);
hudMain->addChatMessage(1, "<system>", msg, 2);
if(n.timeLeft < 180)
{
hudMain->addChatMessage(1, "<system>", gLangMngr.getString("ServerShutdownNoPlaceableObjects"), 2);
gameDoNotAllowToPlaceObjects = true;
}
}
return;
}
Placed below
Code:
IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_MegaphoneChat)//NaraRZ
{
gameShuttedDown_ = true;
char msg[1024];
sprintf(msg, "%s: %s", n.Username, n.Text);
if(hudMain)
{
hudMain->showChatNara(true);
hudMain->addChatMessage(1, n.Username, n.Text, 3);
hudMain->MegaPhoneMiniSystem(msg, n.TextColor, "nara");
}
return;
}
Find
Code:
DEFINE_PACKET_HANDLER(PKT_S2C_UseNetObjectAns);
Placed below
Code:
DEFINE_PACKET_HANDLER(PKT_S2C_MegaphoneChat);//NaraRZ
<-END CLIENT->
<-SERVER->
----------------------------------------
obj_ServerPlayer.h
----------------------------------------
Find
Code:
bool UseItem_CreateNote(const PKT_C2S_CreateNote_s& n);
Placed below
Code:
bool UseItem_RemoveNote(const PKT_C2S_MegaphoneMini_s& n);//NaraRZ
Find
Code:
bool obj_ServerPlayer::IsSwimming()
Put on top
Code:
bool obj_ServerPlayer::UseItem_RemoveNote(const PKT_C2S_MegaphoneMini_s& n)//NaraRZ
{
if (n.SlotFrom >= loadout_->BackpackSize) {
gServerLogic.LogCheat(peerId_, PKT_S2C_CheatWarning_s::CHEAT_Protocol, true, "PKT_C2S_MegaphoneMini_s",
"slot: %d", n.SlotFrom);
return false;
}
wiInventoryItem& wi = loadout_->Items[n.SlotFrom];
uint32_t usedItemId = wi.itemID;
if (wi.itemID != WeaponConfig::ITEMID_MegaphoneMiniItem) {
gServerLogic.LogCheat(peerId_, PKT_S2C_CheatWarning_s::CHEAT_Protocol, true, "PKT_C2S_MegaphoneMini_s",
"itemid: %d vs %d", wi.itemID, WeaponConfig::ITEMID_MegaphoneMiniItem);
return false;
}
if (wi.quantity <= 0) {
gServerLogic.LogCheat(peerId_, PKT_S2C_CheatWarning_s::CHEAT_UseItem, true, "PKT_C2S_MegaphoneMini_s",
"%d", wi.quantity);
return false;
}
// remove used item
wi.quantity--;
if (wi.quantity <= 0) {
wi.Reset();
OnBackpackChanged(n.SlotFrom);
}
gServerLogic.ApiPlayerUpdateChar(this);
return true;
}
----------------------------------------
MasterServerLogic.h
----------------------------------------
Find
Code:
float shutdownLeft_;
Placed below
Code:
bool Megaphone;//NaraRZ
char MegaphoneUsername[128];
char MegaphoneText[1024];
int TextColor;
Find
Code:
void RemovePlayer(int playerIdx);
Placed below
Code:
void SendMegaphone(const char* Username, const char* Text, int TextColor);//NaraRZ
----------------------------------------
MasterServerLogic.cpp
----------------------------------------
Find
Code:
shuttingDown_ = 0;
Placed below
Code:
Megaphone = false;//NaraRZ
Find
Code:
case SBPKT_M2G_ShutdownNote:
{
const SBPKT_M2G_ShutdownNote_s& n = *(SBPKT_M2G_ShutdownNote_s*)packetData;
r3d_assert(sizeof(n) == packetSize);
if(n.reason == 2)
r3dOutToLog("---- Supervisor server is shutting down now\n");
else
r3dOutToLog("---- Master server is shutting down now\n");
shuttingDown_ = n.reason;
shutdownLeft_ = n.timeLeft;
break;
}
Placed below
Code:
case SBPKT_M2G_Megaphone: //NaraRZ
{
const SBPKT_M2G_Megaphone_s& n = *(SBPKT_M2G_Megaphone_s*)packetData;
r3d_assert(sizeof(n) == packetSize);
Megaphone = n.Enable;
TextColor = n.TextColor;
r3dscpy(MegaphoneUsername, n.Username);
r3dscpy(MegaphoneText, n.Text);
break;
}
Find
Code:
void MasterServerLogic::RemovePlayer(int playerIdx)
{
SBPKT_G2M_RemovePlayer_s n(gameId_);
n.playerIdx = (WORD)playerIdx;
net_->SendToHost(&n, sizeof(n), true);
return;
}
Placed below
Code:
void MasterServerLogic::SendMegaphone(const char* Username, const char* Text, int TextColor)//NaraRZ
{
SBPKT_G2M_Megaphone_s n(gameId_);
n.Enable = true;
n.TextColor = TextColor;
r3dscpy(n.Username, Username);
r3dscpy(n.Text, Text);
net_->SendToHost(&n, sizeof(n), true);
return;
}
----------------------------------------
ServerGameLogic.h
----------------------------------------
Find
Code:
int getReputationKillEffect(int repFromPlr, int repKilledPlr);
Placed below
Code:
void MegaPhoneMini(obj_ServerPlayer* fromPlr, const char* name, const char* textWrite, int TextColor);//NaraRZ
Find
Code:
DEFINE_PACKET_FUNC(PKT_C2S_ClientConnection);
Placed below
Code:
DEFINE_PACKET_FUNC(PKT_C2S_MegaphoneMini);//NaraRZ
----------------------------------------
ServerGameLogic.cpp
----------------------------------------
Find
Code:
IMPL_PACKET_FUNC(ServerGameLogic, PKT_C2S_CreateNote)
{
// get player from peer, not from fromObj - more secure, no need to check for peer faking (player peer != p2p peer)
obj_ServerPlayer* fromPlr = GetPeer(peerId).player;
if(!fromPlr) {
return;
}
if(!IsNullTerminated(n.TextFrom, sizeof(n.TextFrom)) || !IsNullTerminated(n.TextSubj, sizeof(n.TextSubj))) {
gServerLogic.LogCheat(peerId, PKT_S2C_CheatWarning_s::CHEAT_Protocol, true, "PKT_C2S_CreateNote",
"no null in text");
return;
}
// relay logic to player
fromPlr->UseItem_CreateNote(n);
return;
}
Placed below
Code:
IMPL_PACKET_FUNC(ServerGameLogic, PKT_C2S_MegaphoneMini)//NaraRZ
{
// get player from peer, not from fromObj - more secure, no need to check for peer faking (player peer != p2p peer)
obj_ServerPlayer* fromPlr = GetPeer(peerId).player;
if(!fromPlr) {
return;
}
if(!IsNullTerminated(n.TextFrom, sizeof(n.TextFrom)) || !IsNullTerminated(n.TextSubj, sizeof(n.TextSubj))) {
gServerLogic.LogCheat(peerId, PKT_S2C_CheatWarning_s::CHEAT_Protocol, true, "PKT_C2S_MegaphoneMini",
"no null in text");
return;
}
MegaPhoneMini(fromPlr, n.TextFrom, n.TextSubj, n.TextColor, true);
fromPlr->UseItem_RemoveNote(n);
return;
}
Find
Code:
DEFINE_PACKET_HANDLER(PKT_C2S_TEST_SpawnDummyReq);
Placed below
Code:
DEFINE_PACKET_HANDLER(PKT_C2S_MegaphoneMini);//NaraRZ
Find
Code:
// shutdown notify logic
Put on top
Code:
if (gMasterServerLogic.Megaphone == true)//NaraRZ
{
gMasterServerLogic.Megaphone = false;
PKT_S2C_MegaphoneChat_s n;
n.TextColor = gMasterServerLogic.TextColor;
r3dscpy(n.Username, gMasterServerLogic.MegaphoneUsername);
r3dscpy(n.Text, gMasterServerLogic.MegaphoneText);
p2pBroadcastToAll(&n, sizeof(n), true);
return;
}
Find
Code:
void ServerGameLogic::SendWeaponsInfoToPlayer(DWORD peerId)
Put on top
Code:
void ServerGameLogic::MegaPhoneMini(obj_ServerPlayer* fromPlr, const char* name, const char* textWrite, int TextColor)//NaraRZ
{
gMasterServerLogic.SendMegaphone(fromPlr->userName, textWrite, TextColor);
return;
}
----------------------------------------
MasterGameServer.h
----------------------------------------
Find
Code:
void RequestShutdown();
Placed below
Code:
void Megaphone();//NaraRZ
bool MegaphoneCheck;
char MegaphoneUsername[128];
char MegaphoneText[1024];
int TextColor;
----------------------------------------
MasterGameServer.cpp
----------------------------------------
Find
Code:
shuttingDown_ = false;
Placed below
Code:
MegaphoneCheck = false;//NaraRZ
Find
Code:
void CMasterGameServer::RequestShutdown()
{
if(shuttingDown_)
return;
r3dOutToLog("--------- SHUTDOWN requested\n");
shuttingDown_ = true;
shutdownLeft_ = 300.0f; // 5 min shutdown
// notify each game about shutdown
for(TGamesList::iterator it = games_.begin(); it != games_.end(); ++it)
{
const CServerG* game = it->second;
SBPKT_M2G_ShutdownNote_s n(game->id_);
n.reason = 1;
n.timeLeft = shutdownLeft_ - 5.0f; // make that game server shutdown 5 sec before us
net_->SendToPeer(&n, sizeof(n), game->peer_, true);
}
}
Placed below
Code:
void CMasterGameServer::Megaphone()//NaraRZ
{
for (TGamesList::iterator it = games_.begin(); it != games_.end(); ++it)
{
const CServerG* game = it->second;
SBPKT_M2G_Megaphone_s n(game->id_);
n.Enable = MegaphoneCheck;
n.TextColor = TextColor;
r3dscpy(n.Username, MegaphoneUsername);
r3dscpy(n.Text, MegaphoneText);
net_->SendToPeer(&n, sizeof(n), game->peer_, true);
}
MegaphoneCheck = false;
return;
}
Find
Code:
if(shuttingDown_) {
shutdownLeft_ -= r3dGetFrameTime();
return;
}
Placed below
Code:
if (MegaphoneCheck == true)
{
Megaphone();
return;
}
Find
Code:
case SBPKT_G2M_RemovePlayer:
{
const SBPKT_G2M_RemovePlayer_s& n = *(SBPKT_G2M_RemovePlayer_s*)PacketData;
r3d_assert(sizeof(n) == PacketSize);
TGamesList::iterator it = games_.find(n.gameId);
r3d_assert(it != games_.end());
CServerG* game = it->second;
game->RemovePlayer(n.playerIdx);
break;
}
Placed below
Code:
case SBPKT_G2M_Megaphone: //NaraRZ
{
const SBPKT_G2M_Megaphone_s& n = *(SBPKT_G2M_Megaphone_s*)PacketData;
r3d_assert(sizeof(n) == PacketSize);
MegaphoneCheck = n.Enable;
TextColor = n.TextColor;
r3dscpy(MegaphoneUsername, n.Username);
r3dscpy(MegaphoneText, n.Text);
break;
}
----------------------------------------
SupervisorGameServer.cpp
----------------------------------------
Find
Code:
case SBPKT_G2M_CloseGame:
Placed below
Code:
case SBPKT_G2M_Megaphone: //NaraRZ
----------------------------------------
SupervisorServer.cpp
----------------------------------------
Find
Code:
case SBPKT_M2G_SetGameFlags:
Placed below
Code:
case SBPKT_M2G_Megaphone: //NaraRZ
<-END SERVER->
//a sample
Last edited: