⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 socketencryptoutputstream.h

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 H
字号:
//////////////////////////////////////////////////////////////////////// // SocketEncryptOutputStream.h // // by Reiot// //////////////////////////////////////////////////////////////////////#ifndef __SOCKET_ENCRYPT_OUTPUT_STREAM_H__#define __SOCKET_ENCRYPT_OUTPUT_STREAM_H__// include files#include "Types.h"#include "Exception.h"#include "SocketOutputStream.h"#include "Encrypter.h"const unsigned int DefaultSocketEncryptOutputBufferSize = 81920;////////////////////////////////////////////////////////////////////////// class SocketEncryptOutputStream////////////////////////////////////////////////////////////////////////class SocketEncryptOutputStream : public SocketOutputStream {//////////////////////////////////////////////////// constructor/destructor//////////////////////////////////////////////////public :		// constructor	SocketEncryptOutputStream (Socket* sock, uint BufferSize = DefaultSocketEncryptOutputBufferSize) throw (Error);	~SocketEncryptOutputStream () throw (Error);	//////////////////////////////////////////////////// methods//////////////////////////////////////////////////public :		// write data to stream (output buffer)	// *CAUTION*	// string 阑 滚欺俊 writing 且 锭, 磊悼栏肺 size 甫 菊俊 嘿老 荐档 乐促.	// 弊矾唱, string 狼 农扁甫 BYTE/WORD 吝 绢蠢 巴栏肺 且 扒瘤绰 狼巩捞促.	// 菩哦狼 农扁绰 累阑 荐废 亮促绰 沥氓窍俊辑 鞘夸俊 蝶扼辑 string size 蔼阑	// BYTE 肚绰 WORD 甫 荐悼栏肺 荤侩窍档废 茄促.    uint writeEncrypt (bool   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (char   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (uchar  buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (short  buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (ushort buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (int    buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (uint   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (long   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }    uint writeEncrypt (ulong  buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write(buf); }/*    uint writeEncrypt (bool   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szbool  ); }    uint writeEncrypt (char   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szchar  ); }    uint writeEncrypt (uchar  buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szuchar ); }    uint writeEncrypt (short  buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szshort ); }    uint writeEncrypt (ushort buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szushort); }    uint writeEncrypt (int    buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szint   ); }    uint writeEncrypt (uint   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szuint  ); }    uint writeEncrypt (long   buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szlong  ); }    uint writeEncrypt (ulong  buf) throw (ProtocolException, Error) { buf = m_Encrypter.convert(buf); return write((const char*)&buf, szulong ); }*/	void	setEncryptCode(uchar code)	{ m_Encrypter.setCode(code); }	uchar   getEncryptCode() const      { return m_Encrypter.getCode(); }//////////////////////////////////////////////////// attributes//////////////////////////////////////////////////private :	Encrypter m_Encrypter;	};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -