SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Friend.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include "CommonNetStructures.h"
10 
11 class Entity;
12 
13 struct Friend
14 {
15 static const constexpr uint32_t class_version = 1;
17  int m_db_id; // m_db_id
18  QString m_name;
19  uint8_t m_class_idx;
20  uint8_t m_origin_idx;
21  int m_map_idx; // if online, then these Packed Bits
22  QString m_mapname; // field_18, probably mapname
23 };
24 
26 {
27 static const constexpr uint32_t class_version = 1;
29  int m_friends_count = 0; // v12
30  std::vector<Friend> m_friends;
31 };
32 
33 void addFriend(Entity &src, Entity &tgt);
34 void removeFriend(Entity &src, Entity &tgt);
35 bool isFriendOnline(Entity &src, uint32_t db_id);
36 void toggleFriendList(Entity &src);
37 void dumpFriends(const Entity &src);
38 void dumpFriendsList(const Friend &f);
int m_friends_count
Definition: Friend.h:29
int m_db_id
Definition: Friend.h:17
static const constexpr uint32_t class_version
Definition: Friend.h:27
uint8_t m_class_idx
Definition: Friend.h:19
bool isFriendOnline(Entity &src, uint32_t db_id)
Definition: Friend.cpp:96
void toggleFriendList(Entity &src)
Definition: Friend.cpp:102
static const constexpr uint32_t class_version
Definition: Friend.h:15
void dumpFriends(const Entity &src)
Definition: Friend.cpp:118
Definition: Friend.h:13
void removeFriend(Entity &src, Entity &tgt)
Definition: Friend.cpp:63
Definition: Entity.h:221
uint8_t m_origin_idx
Definition: Friend.h:20
QString m_mapname
Definition: Friend.h:22
std::vector< Friend > m_friends
Definition: Friend.h:30
Definition: Friend.h:25
bool m_has_friends
Definition: Friend.h:28
bool m_online_status
Definition: Friend.h:16
void dumpFriendsList(const Friend &f)
Definition: Friend.cpp:131
void addFriend(Entity &src, Entity &tgt)
Definition: Friend.cpp:24
QString m_name
Definition: Friend.h:18
int m_map_idx
Definition: Friend.h:21