Fixed the NelNet chat sample
This commit is contained in:
parent
6c94e3ad92
commit
3fa6700408
4 changed files with 5 additions and 4 deletions
|
@ -2,7 +2,7 @@ ADD_EXECUTABLE(nl_sample_chatclient client.cpp kbhit.cpp kbhit.h)
|
|||
|
||||
ADD_EXECUTABLE(nl_sample_chatserver WIN32 server.cpp)
|
||||
|
||||
ADD_DEFINITIONS(-DCHAT_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_chat/\\"")
|
||||
ADD_DEFINITIONS(-DCHAT_DIR="${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_chat/")
|
||||
|
||||
TARGET_LINK_LIBRARIES(nl_sample_chatclient nelmisc nelnet)
|
||||
NL_DEFAULT_PROPS(nl_sample_chatclient "NeL, Samples, Net, Chat: Chat Client")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//NSHost = "localhost";
|
||||
NSHost = "localhost";
|
||||
DontUseNS = 1;
|
||||
DontUseAES = 1;
|
||||
|
||||
ServerPort = "3333";
|
||||
|
|
|
@ -61,7 +61,7 @@ using namespace NLNET;
|
|||
#endif
|
||||
|
||||
#ifndef CHAT_DIR
|
||||
# define CHAT_DIR "."
|
||||
# define CHAT_DIR ""
|
||||
#endif
|
||||
|
||||
string CurrentEditString;
|
||||
|
|
|
@ -71,6 +71,7 @@ void clientSentChat (CMessage &msgin, TSockId from, CCallbackNetBase &netbase)
|
|||
// Called when a client sent a CHAT message
|
||||
string text;
|
||||
msgin.serial(text);
|
||||
nldebug("%s", text.c_str());
|
||||
CMessage msgout;
|
||||
msgout.setType("CHAT");
|
||||
msgout.serial(text);
|
||||
|
|
Loading…
Reference in a new issue