How to fix invite group crash (AllRight) ?
code
Code:
IMPL_PACKET_FUNC(ServerGameLogic, PKT_S2C_SendGroupInvite)
{
char find[128];
r3dscpy(find, n.intogamertag);
obj_ServerPlayer* tplr = FindPlayer(find);
char find1[128];
r3dscpy(find1, n.fromgamertag);
obj_ServerPlayer* plr = FindPlayer(find1);
if (!tplr || !plr)
{
return;
}
if (plr == tplr)
{
return;
}
const float curTime = r3dGetTime();
const float CHAT_DELAY_BETWEEN_MSG = 1.0f; // expected delay between message
const int CHAT_NUMBER_TO_SPAM = 5; // default 4 -number of messages below delay time to be considered spam
float diff = curTime - plr->lastChatTime_;
if (plr)
{
if(diff > CHAT_DELAY_BETWEEN_MSG)
{
plr->numChatMessages_ = 0;
plr->lastChatTime_ = curTime;
}
else
{
plr->numChatMessages_++;
if(plr->numChatMessages_ >= CHAT_NUMBER_TO_SPAM)
{
char message[128] = {0};
PKT_S2C_CheatMsg_s n2;
sprintf(message, "Kicked from server : invalid PKT_C2C_SendGroupinvite - spam"); // fix group
r3dscpy(n2.cheatreason,message);
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendRawToPeer(plr->peerId_, &n2, sizeof(n2));
DisconnectPeer(plr->peerId_, true, "invalid PKT_C2C_SendGroupinvite - spam");
return;
}
}
}
if(tplr && plr)
{
if (!tplr->loadout_->isInvite)
{
char message1[128] = {0};
char message2[128] = {0};
PKT_S2C_ReceivedGroupInvite_s n2;
n2.status = 2;
n2.peerId = plr->peerId_;
sprintf(message1, "Received group from %s",n.fromgamertag);
r3dscpy(n2.text,message1);
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendToPeer(tplr->peerId_, tplr, &n2, sizeof(n2));
PKT_S2C_ReceivedGroupInvite_s n3;
n3.status = 2;
sprintf(message2, "Group invite send successfully",n.fromgamertag);
r3dscpy(n3.text,message2);
n3.peerId = 99999;
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendToPeer(plr->peerId_, plr, &n3, sizeof(n3));
tplr->loadout_->isInvite = true;
plr->loadout_->isInvite = true;
}
else
{
char message2[128] = {0};
PKT_S2C_ReceivedGroupInvite_s n3;
sprintf(message2, "Allready Invited");
r3dscpy(n3.text,message2);
n3.peerId = 99999;
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendToPeer(plr->peerId_, plr, &n3, sizeof(n3));
}
}
}
- - - Updated - - -
if invite a player to group > client kick and crash....
Re: How to fix invite group crash (AllRight) ?
Re: How to fix invite group crash (AllRight) ?
Quote:
Originally Posted by
javaz97
code
Code:
IMPL_PACKET_FUNC(ServerGameLogic, PKT_S2C_SendGroupInvite)
{
char find[128];
r3dscpy(find, n.intogamertag);
obj_ServerPlayer* tplr = FindPlayer(find);
char find1[128];
r3dscpy(find1, n.fromgamertag);
obj_ServerPlayer* plr = FindPlayer(find1);
if (!tplr || !plr)
{
return;
}
if (plr == tplr)
{
return;
}
const float curTime = r3dGetTime();
const float CHAT_DELAY_BETWEEN_MSG = 1.0f; // expected delay between message
const int CHAT_NUMBER_TO_SPAM = 5; // default 4 -number of messages below delay time to be considered spam
float diff = curTime - plr->lastChatTime_;
if (plr)
{
if(diff > CHAT_DELAY_BETWEEN_MSG)
{
plr->numChatMessages_ = 0;
plr->lastChatTime_ = curTime;
}
else
{
plr->numChatMessages_++;
if(plr->numChatMessages_ >= CHAT_NUMBER_TO_SPAM)
{
char message[128] = {0};
PKT_S2C_CheatMsg_s n2;
sprintf(message, "Kicked from server : invalid PKT_C2C_SendGroupinvite - spam"); // fix group
r3dscpy(n2.cheatreason,message);
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendRawToPeer(plr->peerId_, &n2, sizeof(n2));
DisconnectPeer(plr->peerId_, true, "invalid PKT_C2C_SendGroupinvite - spam");
return;
}
}
}
if(tplr && plr)
{
if (!tplr->loadout_->isInvite)
{
char message1[128] = {0};
char message2[128] = {0};
PKT_S2C_ReceivedGroupInvite_s n2;
n2.status = 2;
n2.peerId = plr->peerId_;
sprintf(message1, "Received group from %s",n.fromgamertag);
r3dscpy(n2.text,message1);
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendToPeer(tplr->peerId_, tplr, &n2, sizeof(n2));
PKT_S2C_ReceivedGroupInvite_s n3;
n3.status = 2;
sprintf(message2, "Group invite send successfully",n.fromgamertag);
r3dscpy(n3.text,message2);
n3.peerId = 99999;
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendToPeer(plr->peerId_, plr, &n3, sizeof(n3));
tplr->loadout_->isInvite = true;
plr->loadout_->isInvite = true;
}
else
{
char message2[128] = {0};
PKT_S2C_ReceivedGroupInvite_s n3;
sprintf(message2, "Allready Invited");
r3dscpy(n3.text,message2);
n3.peerId = 99999;
//gServerLogic.p2pSendToPeer(peerId_, NULL, &n2, sizeof(n2));
gServerLogic.p2pSendToPeer(plr->peerId_, plr, &n3, sizeof(n3));
}
}
}
- - - Updated - - -
if invite a player to group > client kick and crash....
very strange, me i have tested group system and work fine ....
Re: How to fix invite group crash (AllRight) ?
log
Line 1263: 002544.710| !!! cheat: peer02, r:DisconnectPeer invalid PKT_C2C_SendGroupinvite - spam, CID:1001911 [EternityBox], ip:58.9.213.xx
Line 3745: 006111.420| !!! cheat: peer00, r:DisconnectPeer invalid PKT_C2C_SendGroupinvite - spam, CID:1003448 [LASVEGAS], ip:58.9.213.xx
Line 4991: 007613.606| !!! cheat: peer07, r:DisconnectPeer invalid PKT_C2C_SendGroupinvite - spam, CID:1001790 [VEGAS], ip:61.90.124.xx
Line 8707: 014304.512| !!! cheat: peer01, r:DisconnectPeer invalid PKT_C2C_SendGroupinvite - spam, CID:1007615 [poov], ip:58.9.213.xx
Re: How to fix invite group crash (AllRight) ?
Re: How to fix invite group crash (AllRight) ?
Re: How to fix invite group crash (AllRight) ?
Re: How to fix invite group crash (AllRight) ?
None is going to help you, you can stop asking and bumping your thread like a retard^^
Re: How to fix invite group crash (AllRight) ?
Re: How to fix invite group crash (AllRight) ?