actully it work perfect ... in my server 1 thing that noone never release has released just click on the thx button noobs ...
actully it work perfect ... in my server 1 thing that noone never release has released just click on the thx button noobs ...
Stay on topic in order to avoid all the spam. Thanks.
Best thing i would do would be to make it work via the database, so when logging in your account is checked via database on when you last did the wall etc...
Great release!
dosent work.
Last edited by Rejain; 06-10-12 at 06:56 PM.
MMatchObject.h - Line 1184
MMatchObject.h - Line 1192Code:inline bool IsVipGrade(MMatchUserGradeID nGrade) { if (nGrade == MMUG_VIP1) return true; return false; }
MMatchServer_Admin.cpp - Function OnAdminAnnounce add this:Code:inline bool IsVipGrade(MMatchObject* pObject) { if (pObject == NULL) return false; return IsVipGrade(pObject->GetAccountInfo()->m_nUGrade); }
For More Security (:Code:if (!IsAdminGrade(pObj) && !IsVipGrade(pObj)) { DisconnectObject(uidAdmin); return; }
Last edited by gaspartx; 04-11-12 at 05:30 AM.
This is awful. Take a look at an improper implementation, but it's better than having no server checks at all:
Ideally you would want to save the time to a database, grab the variable from the database and load it into memory. Use a UNIX timestamp that gets loaded from the account information upon login. Since I don't feel like typing all of that here and writing the storedproc, here's a cheap implementation that should get you started with an idea of what should be done:
Bottom of MMatchObject::MMatchObject, MMatchObject.cpp
MMatchObject.h, in any public space in the class of MMatchObject:m_dwLastAnnounceMessageTime = timeGetTime();
Modified command handler (MMATCH_VIP_REQUEST_CHAT)DWORD m_dwLastAnnounceMessageTime;
void MMatchServer::OnRequestVIP(const MUID& uidAdmin, const MUID& uidVictim, const char* szMessage)
{
MMatchObject* pVIP= GetObject(uidAdmin);
if(pVIP== NULL) return;
if (!IsVIPGrade(pVIP)) return; // Should return the UGrade of VIP Status. You can include something like || IsAdminGrade(pVip) here but I would do it inside the function for cleanliness.
if(!(timeGetTime() < pVIP->m_dwLastAnnounceMessageTime)) return; //This should be changed to load from the account info as a unix timestamp, not a timeGetTime variable stored in runtime memory. Otherwise, you can relog and spam the server!
MCommand* pCmd = CreateCommand(MC_ADMIN_ANNOUNCE, MUID(0,0));
pCmd->AddParameter(new MCmdParamUID(uidAdmin));
pCmd->AddParameter(new MCmdParamStr(szMessage));
pCmd->AddParameter(new MCmdParamUInt(0));
RouteToAllClient(pCmd);
pVIP->m_dwLastAnnounceMessageTime = timeGetTime() + 3600000; //Probably should load this from some server INI (or better yet, add varying grades that have different times per grade!)
}