-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendclientmessage.h
More file actions
40 lines (32 loc) · 1.42 KB
/
sendclientmessage.h
File metadata and controls
40 lines (32 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "common/macros.h"
#include "gameroot.h"
#include "gameserver.h"
#include "dz.pb.h"
namespace game
{
namespace message
{
int sendClientMessage(const long &pid, int eMSG, const std::vector<char> &vecData, GameRoot *root);
int sendClientMessage(const long &pid, vector<int> &eMSG, const std::vector<vector<char> > &vecData, GameRoot *root);
int sendAllClientMessage(int eMSG, const std::vector<char> &vecData, GameRoot *root);
int sendAllClientMessage(vector<int> &eMSG, const std::vector<vector<char> > &vecData, GameRoot *root);
int sendClientWatchGameData(int eMSG, const std::vector<char> &vecData, GameRoot *root);
int sendClientWatchGameData(vector<int> &eMSG, const std::vector<vector<char> > &vecData, GameRoot *root);
template<class T>
int sendClientMessage(const long &uid, int eMSG, T const &TMsg, GameRoot *root)
{
return sendClientMessage(uid, eMSG, pbTobuffer(TMsg), root);
}
template<class T>
int sendAllClientMessage(int eMSG, T const &TMsg, GameRoot *root)
{
return sendAllClientMessage(eMSG, pbTobuffer(TMsg), root);
}
template<class T>
int sendClientWatchGameData(int eMSG, T const &TMsg, GameRoot *root)
{
return sendClientWatchGameData(eMSG, pbTobuffer(TMsg), root);
}
};
};