Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
NetChat.cpp
Go to the documentation of this file.
1
/* Project Starshatter 4.5
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: Stars.exe
6
FILE: NetChat.cpp
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
Single chat message and sender
13
*/
14
15
16
#include "
MemDebug.h
"
17
#include "
NetChat.h
"
18
#include "
NetLayer.h
"
19
20
// +-------------------------------------------------------------------+
21
22
static
int
chat_id_key = 1000;
23
24
// +-------------------------------------------------------------------+
25
26
NetChatEntry::NetChatEntry
(
const
NetUser
* u,
const
char
* s)
27
: id(chat_id_key++), msg(s)
28
{
29
if
(u) {
30
user = u->
Name
();
31
color = u->
GetColor
();
32
}
33
else
{
34
user =
"unknown"
;
35
color =
Color::Gray
;
36
}
37
38
time =
NetLayer::GetUTC
();
39
}
40
41
NetChatEntry::NetChatEntry
(
int
msg_id,
const
char
* u,
const
char
* s)
42
: id(msg_id), user(u), msg(s)
43
{
44
color =
Color::Gray
;
45
time =
NetLayer::GetUTC
();
46
47
if
(
id
>= chat_id_key)
48
chat_id_key =
id
+ 1;
49
}
50
51
NetChatEntry::~NetChatEntry
()
52
{ }
53
Stars45
NetChat.cpp
Generated on Tue Jun 5 2012 20:47:02 for Starshatter_Open by
1.8.1