• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision6aafe536499e73bfaf2214099c3a189a9c2ce2a2 (tree)
Time2012-09-13 01:13:47
Authorangeart <angeart@git....>
Commiterangeart

Log Message

Merge branch 'master' of git.sourceforge.jp:/gitroot/mmo/main

Change Summary

Incremental Difference

--- a/common/Logger.hpp
+++ b/common/Logger.hpp
@@ -7,7 +7,7 @@
77 #include "unicode.hpp"
88
99 #ifndef _WIN32
10-#define OutputDebugString(str) (str)
10+#define OutputDebugString(str) (std::cout << str)
1111 #endif
1212
1313 class Logger {
@@ -114,41 +114,41 @@ class Logger {
114114 void Log(const tstring& prefix, const tstring& format) {
115115 auto out = prefix + format + _T("\n");
116116 OutputDebugString(out.c_str());
117- std::wcout << unicode::ToWString(out);
118- ofs_ << unicode::ToString(out);
117+ // std::wcout << unicode::ToWString(out);
118+ //ofs_ << unicode::ToString(out);
119119 }
120120
121121 template<class T1>
122122 void Log(const tstring& prefix, const tstring& format, const T1& t1) {
123123 auto out = prefix + (tformat(format) % t1).str() + _T("\n");
124124 OutputDebugString(out.c_str());
125- std::wcout << unicode::ToWString(out);
126- ofs_ << unicode::ToString(out);
125+ // std::wcout << unicode::ToWString(out);
126+ //ofs_ << unicode::ToString(out);
127127 }
128128
129129 template<class T1, class T2>
130130 void Log(const tstring& prefix, const tstring& format, const T1& t1, const T2& t2) {
131131 auto out = prefix + (tformat(format) % t1 % t2).str() + _T("\n");
132132 OutputDebugString(out.c_str());
133- std::wcout << unicode::ToWString(out);
134- ofs_ << unicode::ToString(out);
133+ // std::wcout << unicode::ToWString(out);
134+ //ofs_ << unicode::ToString(out);
135135 }
136136
137137 template<class T1, class T2, class T3>
138138 void Log(const tstring& prefix, const tstring& format, const T1& t1, const T2& t2, const T3& t3) {
139139 auto out = prefix + (tformat(format) % t1 % t2 % t3).str() + _T("\n");
140140 OutputDebugString(out.c_str());
141- std::wcout << unicode::ToWString(out);
142- ofs_ << unicode::ToString(out);
141+ // std::wcout << unicode::ToWString(out);
142+ //ofs_ << unicode::ToString(out);
143143 }
144144
145145 template<class T1, class T2, class T3, class T4>
146146 void Log(const tstring& prefix, const tstring& format, const T1& t1, const T2& t2, const T3& t3, const T4& t4) {
147147 auto out = prefix + (tformat(format) % t1 % t2 % t3 % t4).str() + _T("\n");
148148 OutputDebugString(out.c_str());
149- std::wcout << unicode::ToWString(out);
150- ofs_ << unicode::ToString(out);
149+ // std::wcout << unicode::ToWString(out);
150+ //ofs_ << unicode::ToString(out);
151151 }
152152
153- std::ofstream ofs_;
153+ std::ofstream ofs_;
154154 };
--- a/common/network/Encrypter.cpp
+++ b/common/network/Encrypter.cpp
@@ -166,10 +166,10 @@ std::string Encrypter::GetPublicKeyFingerPrint()
166166
167167 std::string Encrypter::GetHash(const std::string& in)
168168 {
169- std::unique_ptr<byte[]> outbuf(new byte [CryptoPP::SHA512().DIGESTSIZE]);
169+ std::unique_ptr<byte[]> outbuf(new byte [64]);
170170 CryptoPP::SHA512().CalculateDigest(outbuf.get(), (const byte*)in.data(), in.size());
171171
172- return std::string((char*)outbuf.get(), CryptoPP::SHA512().DIGESTSIZE);
172+ return std::string((char*)outbuf.get(), 64);
173173 }
174174
175175 std::string Encrypter::GetTrip(const std::string& in)
--- a/common/unicode.hpp
+++ b/common/unicode.hpp
@@ -28,8 +28,8 @@ namespace unicode {
2828
2929 #ifdef _WIN32
3030
31-std::string sjis2utf8(const std::string&);
32-std::string utf82sjis(const std::string&);
31+std::string sjis2utf8(std::string);
32+std::string utf82sjis(std::string);
3333
3434 std::string ToString(const std::wstring& s);
3535 std::wstring ToWString(const std::string& s);
--- a/server/Makefile
+++ b/server/Makefile
@@ -2,14 +2,15 @@ CC = gcc
22 CXX = g++
33 LD = g++
44
5-CXXFLAGS = -g -ggdb -Wall -std=gnu++0x
6-LIBS = -lboost_system -lboost_thread -lboost_date_time -lboost_filesystem -lboost_regex \
7- -lpthread -lssl -lcrypto -ldl -lrt
8-LIBDIRS = -L/usr/local/lib
5+CXXFLAGS = -g -ggdb -Wall -std=gnu++0x -I/usr/include/cryptopp
6+LIBS = -lcryptopp -lboost_system -lboost_thread -lboost_date_time -lboost_filesystem -lboost_regex \
7+ -lpthread -lssl -ldl -lrt
8+LIBDIRS = -L/usr/lib -L/usr/local/lib
99
1010 TARGET = server
1111 OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
1212 OBJS += $(patsubst %.cpp,%.o,$(wildcard ../common/network/*.cpp))
13+OBJS += $(patsubst %.c,%.o,$(wildcard ../common/network/lz4/*.c))
1314
1415 all: $(OBJS)
1516 $(LD) $(CXXFLAGS) -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIRS)
--- a/server/Server.cpp
+++ b/server/Server.cpp
@@ -5,6 +5,7 @@
55 #include "Server.hpp"
66 #include <algorithm>
77 #include <boost/make_shared.hpp>
8+#include <boost/foreach.hpp>
89 #include "../common/Logger.hpp"
910 #include "../common/network/Command.hpp"
1011 #include "../common/network/Utils.hpp"