Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetMessage.h
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2016 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | public: | ||||
virtual size_t GetSerializedLength() const; | virtual size_t GetSerializedLength() const; | ||||
virtual CStr ToString() const; | virtual CStr ToString() const; | ||||
JS::PersistentRootedValue m_Data; | JS::PersistentRootedValue m_Data; | ||||
private: | private: | ||||
ScriptInterface& m_ScriptInterface; | ScriptInterface& m_ScriptInterface; | ||||
}; | }; | ||||
/** | |||||
* Special message type to send single setting changes. | |||||
*/ | |||||
class CChangeSettingMessage : public CNetMessage | |||||
{ | |||||
NONCOPYABLE(CChangeSettingMessage); | |||||
public: | |||||
CChangeSettingMessage(ScriptInterface& scriptInterface); | |||||
CChangeSettingMessage(ScriptInterface& scriptInterface, CStr& guid, JS::HandleValue data); | |||||
virtual u8* Serialize(u8* pBuffer) const; | |||||
virtual const u8* Deserialize(const u8* pStart, const u8* pEnd); | |||||
virtual size_t GetSerializedLength() const; | |||||
virtual CStr ToString() const; | |||||
CStr m_GUID; | |||||
JS::PersistentRootedValue m_Data; | |||||
private: | |||||
ScriptInterface& m_ScriptInterface; | |||||
}; | |||||
// This time, the classes are created | // This time, the classes are created | ||||
#include "NetMessages.h" | #include "NetMessages.h" | ||||
#endif // NETMESSAGE_H | #endif // NETMESSAGE_H |
Wildfire Games · Phabricator