1 /* bzflag
2  * Copyright (c) 1993-2021 Tim Riker
3  *
4  * This package is free software;  you can redistribute it and/or
5  * modify it under the terms of the license found in the file
6  * named COPYING that should have accompanied this file.
7  *
8  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11  */
12 
13 #ifndef __MSG_STRINGS_H__
14 #define __MSG_STRINGS_H__
15 
16 
17 // common headers
18 #include "common.h"
19 
20 // system headers
21 #include <string>
22 #include <vector>
23 #include <map>
24 
25 typedef struct
26 {
27     int level;
28     std::string text;
29     std::string color;
30 } MsgString;
31 
32 typedef std::vector<MsgString> MsgStringList;
33 
34 namespace MsgStrings
35 {
36 
37 // returns the name of the code  (doesn't need init())
38 const char *strMsgCode(uint16_t code);
39 
40 void init();
41 void reset();         // clean up all tracked state
42 void useDNS(bool);        // look up hostnames based on IPs?
43 void showMotto(bool);     // show player mottos next to names?
44 void colorize(bool);      // use ANSI color codes?
45 void trackState(bool);    // track game state?
46 
47 int knownPacketTypes();
48 
49 // Messages from the server to the client
50 MsgStringList msgFromServer(uint16_t len, uint16_t code, const void *data);
51 
52 // Messages from the client to the server  (currently unimplemented)
53 MsgStringList msgFromClient(uint16_t len, uint16_t code, const void *data);
54 }
55 
56 #endif // __MSG_STRINGS_H__
57 
58 
59 // Local Variables: ***
60 // mode: C++ ***
61 // tab-width: 4 ***
62 // c-basic-offset: 4 ***
63 // indent-tabs-mode: nil ***
64 // End: ***
65 // ex: shiftwidth=4 tabstop=4
66