Servera Giriş Notice Eklemek

SERCAN

Administrator
Katılım
6 Temmuz 2025
Mesajlar
8
Reaksiyon puanı
0
Puanları
1
User.h eklenecekler

C++:
void GirisNotice();

Gameserver içine WellComeNotice.cpp Oluşturup içine eklenecekler

C++:
#include "stdafx.h"

void CUser::GirisNotice()
{
    DateTime time;
    std::string GirisNotice;
    std::string ServerDuyuru;
    std::string Welcome;
    GirisNotice = string_format("HoşGeldiniz");
    ServerDuyuru = string_format("Server Time : %04d-%02d-%02d %02d:%02d", time.GetYear(), time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute());
    Welcome = string_format("Hello %s", GetName().c_str());
    Packet SecurityNotice(WIZ_CHAT, uint8(GENERAL_CHAT));
    SecurityNotice << GetNation() << GetSocketID() << uint8(0) << GirisNotice;
    Send(&SecurityNotice);
    Packet DuyuruNotice(WIZ_CHAT, uint8(PUBLIC_CHAT));
    DuyuruNotice << GetNation() << GetSocketID() << uint8(0) << ServerDuyuru;
    Send(&DuyuruNotice);
    Packet WelcomeNotice(WIZ_CHAT, uint8(PUBLIC_CHAT));
    WelcomeNotice << GetNation() << GetSocketID() << uint8(0) << Welcome;
    Send(&WelcomeNotice);
}

void CUser::SendMyInfo() içine eklenecek kod. (Void içine herhangi bi yere ekleyebilirsiniz.)

C++:
{
GirisNotice();
 
Geri
Üst