mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 08:21:28 +00:00
Backward port to OSX 10.6 (Snow Leopard)
This commit is contained in:
parent
f6046477b4
commit
0f67e93a0f
@ -55,10 +55,17 @@ namespace EQEmu {
|
|||||||
std::string final_name = name;
|
std::string final_name = name;
|
||||||
final_name += ".lock";
|
final_name += ".lock";
|
||||||
|
|
||||||
|
#ifdef __DARWIN
|
||||||
|
#if __DARWIN_C_LEVEL < 200809L
|
||||||
imp_->fd_ = open(final_name.c_str(),
|
imp_->fd_ = open(final_name.c_str(),
|
||||||
O_RDWR | O_CREAT | O_CLOEXEC,
|
O_RDWR | O_CREAT,
|
||||||
S_IRUSR | S_IWUSR);
|
S_IRUSR | S_IWUSR);
|
||||||
|
#else
|
||||||
|
imp_->fd_ = open(final_name.c_str(),
|
||||||
|
O_RDWR | O_CREAT | O_CLOEXEC,
|
||||||
|
S_IRUSR | S_IWUSR);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
if(imp_->fd_ == -1) {
|
if(imp_->fd_ == -1) {
|
||||||
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12483,7 +12483,15 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app)
|
|||||||
//
|
//
|
||||||
|
|
||||||
char *GuildName = (char *)app->pBuffer;
|
char *GuildName = (char *)app->pBuffer;
|
||||||
|
#ifdef DARWIN
|
||||||
|
#if __DARWIN_C_LEVEL < 200809L
|
||||||
|
if (strlen(GuildName) > 60)
|
||||||
|
#else
|
||||||
if(strnlen(GuildName, 64) > 60)
|
if(strnlen(GuildName, 64) > 60)
|
||||||
|
#endif // __DARWIN_C_LEVEL
|
||||||
|
#else
|
||||||
|
if(strnlen(GuildName, 64) > 60)
|
||||||
|
#endif // DARWIN
|
||||||
{
|
{
|
||||||
Message(clientMessageError, "Guild name too long.");
|
Message(clientMessageError, "Guild name too long.");
|
||||||
return;
|
return;
|
||||||
@ -12941,7 +12949,15 @@ void Client::Handle_OP_LFGuild(const EQApplicationPacket *app)
|
|||||||
VERIFY_PACKET_LENGTH(OP_LFGuild, app, LFGuild_PlayerToggle_Struct);
|
VERIFY_PACKET_LENGTH(OP_LFGuild, app, LFGuild_PlayerToggle_Struct);
|
||||||
LFGuild_PlayerToggle_Struct *pts = (LFGuild_PlayerToggle_Struct *)app->pBuffer;
|
LFGuild_PlayerToggle_Struct *pts = (LFGuild_PlayerToggle_Struct *)app->pBuffer;
|
||||||
|
|
||||||
|
#ifdef DARWIN
|
||||||
|
#if __DARWIN_C_LEVEL < 200809L
|
||||||
|
if (strlen(pts->Comment) > 256)
|
||||||
|
#else
|
||||||
if(strnlen(pts->Comment, 256) > 256)
|
if(strnlen(pts->Comment, 256) > 256)
|
||||||
|
#endif // __DARWIN_C_LEVEL
|
||||||
|
#else
|
||||||
|
if(strnlen(pts->Comment, 256) > 256)
|
||||||
|
#endif // DARWIN
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(GetName()) + strlen(pts->Comment) + 38);
|
ServerPacket* pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(GetName()) + strlen(pts->Comment) + 38);
|
||||||
@ -12968,7 +12984,15 @@ void Client::Handle_OP_LFGuild(const EQApplicationPacket *app)
|
|||||||
VERIFY_PACKET_LENGTH(OP_LFGuild, app, LFGuild_GuildToggle_Struct);
|
VERIFY_PACKET_LENGTH(OP_LFGuild, app, LFGuild_GuildToggle_Struct);
|
||||||
LFGuild_GuildToggle_Struct *gts = (LFGuild_GuildToggle_Struct *)app->pBuffer;
|
LFGuild_GuildToggle_Struct *gts = (LFGuild_GuildToggle_Struct *)app->pBuffer;
|
||||||
|
|
||||||
if(strnlen(gts->Comment, 256) > 256)
|
#ifdef DARWIN
|
||||||
|
#if __DARWIN_C_LEVEL < 200809L
|
||||||
|
if (strlen(gts->Comment) > 256)
|
||||||
|
#else
|
||||||
|
if(strnlen(gts->Comment, 256) > 256)
|
||||||
|
#endif // __DARWIN_C_LEVEL
|
||||||
|
#else
|
||||||
|
if(strnlen(gts->Comment, 256) > 256)
|
||||||
|
#endif // __DARWIN
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ServerPacket* pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(GetName()) + strlen(gts->Comment) + strlen(guild_mgr.GetGuildName(GuildID())) + 43);
|
ServerPacket* pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(GetName()) + strlen(gts->Comment) + strlen(guild_mgr.GetGuildName(GuildID())) + 43);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user