2020-10-19 17:26:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Player.hpp"
|
|
|
|
#include "CNProtocol.hpp"
|
|
|
|
#include "CNStructs.hpp"
|
|
|
|
#include "CNShardServer.hpp"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
namespace BuddyManager {
|
|
|
|
void init();
|
|
|
|
|
2020-11-08 17:42:27 +00:00
|
|
|
// Buddy list
|
|
|
|
void refreshBuddyList(CNSocket* sock);
|
|
|
|
|
2020-10-19 17:26:14 +00:00
|
|
|
// Buddy requests
|
|
|
|
void requestBuddy(CNSocket* sock, CNPacketData* data);
|
2020-09-19 19:07:09 +00:00
|
|
|
void reqBuddyByName(CNSocket* sock, CNPacketData* data);
|
2020-10-05 00:03:13 +00:00
|
|
|
|
2020-10-19 17:26:14 +00:00
|
|
|
// Buddy accepting
|
2020-09-19 19:07:09 +00:00
|
|
|
void reqAcceptBuddy(CNSocket* sock, CNPacketData* data);
|
|
|
|
void reqFindNameBuddyAccept(CNSocket* sock, CNPacketData* data);
|
2020-10-05 00:03:13 +00:00
|
|
|
|
2020-10-19 17:26:14 +00:00
|
|
|
// Getting buddy state
|
2020-09-19 19:07:09 +00:00
|
|
|
void reqPktGetBuddyState(CNSocket* sock, CNPacketData* data);
|
2020-10-05 00:03:13 +00:00
|
|
|
|
2020-10-19 17:26:14 +00:00
|
|
|
// Blocking/removing buddies
|
2020-09-21 18:28:04 +00:00
|
|
|
void reqBuddyBlock(CNSocket* sock, CNPacketData* data);
|
2020-12-05 00:29:08 +00:00
|
|
|
void reqPlayerBlock(CNSocket* sock, CNPacketData* data);
|
2020-09-21 18:28:04 +00:00
|
|
|
void reqBuddyDelete(CNSocket* sock, CNPacketData* data);
|
2020-09-22 17:02:00 +00:00
|
|
|
|
2020-10-19 17:26:14 +00:00
|
|
|
// Buddy warping
|
2020-09-22 17:02:00 +00:00
|
|
|
void reqBuddyWarp(CNSocket* sock, CNPacketData* data);
|
2020-10-19 17:26:14 +00:00
|
|
|
|
|
|
|
// helper methods
|
2020-10-27 15:28:37 +00:00
|
|
|
|
2020-10-19 17:26:14 +00:00
|
|
|
// Name checks
|
2020-11-08 04:11:56 +00:00
|
|
|
int getAvailableBuddySlot(Player* plr);
|
2020-11-09 09:41:20 +00:00
|
|
|
bool playerHasBuddyWithID(Player* plr, int buddyID);
|
2020-09-19 19:07:09 +00:00
|
|
|
}
|