mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2025-08-18 12:45:36 +00:00
Assert nullptrs in VehicleData
we'll nuke this file anyways, but for now lets be safe about ptrs.
This commit is contained in:
parent
b2166402a2
commit
aa73a9d16a
@ -32,6 +32,7 @@ SOCKET UDPSock;
|
|||||||
std::set<PacketData*> DataAcks;
|
std::set<PacketData*> DataAcks;
|
||||||
std::set<SplitData*> SplitPackets;
|
std::set<SplitData*> SplitPackets;
|
||||||
void UDPSend(Client* c, std::string Data) {
|
void UDPSend(Client* c, std::string Data) {
|
||||||
|
Assert(c);
|
||||||
if (c == nullptr || !c->isConnected || c->GetStatus() < 0)
|
if (c == nullptr || !c->isConnected || c->GetStatus() < 0)
|
||||||
return;
|
return;
|
||||||
sockaddr_in Addr = c->GetUDPAddr();
|
sockaddr_in Addr = c->GetUDPAddr();
|
||||||
@ -82,6 +83,7 @@ int SplitID() {
|
|||||||
return SID;
|
return SID;
|
||||||
}
|
}
|
||||||
void SendLarge(Client* c, std::string Data) {
|
void SendLarge(Client* c, std::string Data) {
|
||||||
|
Assert(c);
|
||||||
Data = Data.substr(0, Data.find(char(0)));
|
Data = Data.substr(0, Data.find(char(0)));
|
||||||
int ID = PacktID();
|
int ID = PacktID();
|
||||||
std::string Packet;
|
std::string Packet;
|
||||||
@ -118,6 +120,7 @@ void ResetIDs(HandledC* H) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
HandledC* GetHandled(Client* c) {
|
HandledC* GetHandled(Client* c) {
|
||||||
|
Assert(c);
|
||||||
for (HandledC* h : HandledIDs) {
|
for (HandledC* h : HandledIDs) {
|
||||||
if (h->c == c) {
|
if (h->c == c) {
|
||||||
return h;
|
return h;
|
||||||
@ -126,6 +129,7 @@ HandledC* GetHandled(Client* c) {
|
|||||||
return new HandledC();
|
return new HandledC();
|
||||||
}
|
}
|
||||||
bool Handled(Client* c, int ID) {
|
bool Handled(Client* c, int ID) {
|
||||||
|
Assert(c);
|
||||||
bool handle = false;
|
bool handle = false;
|
||||||
for (HandledC* h : HandledIDs) {
|
for (HandledC* h : HandledIDs) {
|
||||||
if (h->c == c) {
|
if (h->c == c) {
|
||||||
@ -184,6 +188,7 @@ SplitData* GetSplit(int SplitID) {
|
|||||||
return SP;
|
return SP;
|
||||||
}
|
}
|
||||||
void HandleChunk(Client* c, const std::string& Data) {
|
void HandleChunk(Client* c, const std::string& Data) {
|
||||||
|
Assert(c);
|
||||||
int pos = FC(Data, "|", 5);
|
int pos = FC(Data, "|", 5);
|
||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
return;
|
return;
|
||||||
@ -219,6 +224,7 @@ void HandleChunk(Client* c, const std::string& Data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void UDPParser(Client* c, std::string Packet) {
|
void UDPParser(Client* c, std::string Packet) {
|
||||||
|
Assert(c);
|
||||||
if (Packet.substr(0, 4) == "ABG:") {
|
if (Packet.substr(0, 4) == "ABG:") {
|
||||||
Packet = DeComp(Packet.substr(4));
|
Packet = DeComp(Packet.substr(4));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user