SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
LinkLevelEvent.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 #include <cassert>
10 #include <ace/INET_Addr.h>
11 #include "SEGSEvent.h"
12 
13 namespace SEGSEvents {
14 // [[ev_def:type]]
15 class Connect : public Event
16 {
17 public:
18  Connect(EventSrc *ev_src=nullptr) : Event(evConnect,ev_src)
19  {
20  }
21  Connect(EventSrc *ev_src,const ACE_INET_Addr &addr) :
22  Event(evConnect,ev_src),
23  src_addr(addr)
24  {
25  assert(ev_src);
26  }
28  // [[ev_def:field]]
29  ACE_INET_Addr src_addr;
30 };
31 // [[ev_def:type]]
32 class Disconnect : public Event
33 {
34 public:
35  // [[ev_def:field]]
36  uint64_t m_session_token;
37  Disconnect(EventSrc *ev_src=nullptr) : Event(evDisconnect,ev_src)
38  {
39  }
40  Disconnect(uint64_t token) : Event(evDisconnect,nullptr),m_session_token(token)
41  {
42  }
44 };
45 } // end of SEGSEvents namespace
Definition: EventProcessor.h:14
Definition: SEGSEvent.h:35
Disconnect(uint64_t token)
Definition: LinkLevelEvent.h:40
ACE_INET_Addr src_addr
Definition: LinkLevelEvent.h:29
Definition: LinkLevelEvent.h:13
on the link level this means a new connection, higher level handlers are also notified by this event ...
Definition: SEGSEvent.h:30
Connect(EventSrc *ev_src=nullptr)
Definition: LinkLevelEvent.h:18
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77
Definition: LinkLevelEvent.h:32
Connect(EventSrc *ev_src, const ACE_INET_Addr &addr)
Definition: LinkLevelEvent.h:21
Disconnect(EventSrc *ev_src=nullptr)
Definition: LinkLevelEvent.h:37
Definition: SEGSEvent.h:29
Definition: LinkLevelEvent.h:15
uint64_t m_session_token
Definition: LinkLevelEvent.h:36