-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
671cf08
commit 7dc48a1
Showing
16 changed files
with
190 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <Messages/DialogueRequest.h> | ||
|
||
void DialogueRequest::SerializeRaw(TiltedPhoques::Buffer::Writer& aWriter) const noexcept | ||
{ | ||
Serialization::WriteVarInt(aWriter, ServerId); | ||
Serialization::WriteString(aWriter, SoundFilename); | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
|
||
void DialogueRequest::DeserializeRaw(TiltedPhoques::Buffer::Reader& aReader) noexcept | ||
{ | ||
ClientMessage::DeserializeRaw(aReader); | ||
|
||
ServerId = Serialization::ReadVarInt(aReader) & 0xFFFFFFFF; | ||
SoundFilename = Serialization::ReadString(aReader); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "Message.h" | ||
|
||
using TiltedPhoques::String; | ||
|
||
struct DialogueRequest final : ClientMessage | ||
{ | ||
static constexpr ClientOpcode Opcode = kDialogueRequest; | ||
|
||
DialogueRequest() : ClientMessage(Opcode) | ||
{ | ||
} | ||
|
||
void SerializeRaw(TiltedPhoques::Buffer::Writer& aWriter) const noexcept override; | ||
void DeserializeRaw(TiltedPhoques::Buffer::Reader& aReader) noexcept override; | ||
|
||
bool operator==(const DialogueRequest& acRhs) const noexcept | ||
{ | ||
return GetOpcode() == acRhs.GetOpcode() && | ||
ServerId == acRhs.ServerId && | ||
SoundFilename == acRhs.SoundFilename; | ||
} | ||
|
||
uint32_t ServerId{}; | ||
TiltedPhoques::String SoundFilename{}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <Messages/NotifyDialogue.h> | ||
|
||
void NotifyDialogue::SerializeRaw(TiltedPhoques::Buffer::Writer& aWriter) const noexcept | ||
{ | ||
Serialization::WriteVarInt(aWriter, ServerId); | ||
Serialization::WriteString(aWriter, SoundFilename); | ||
} | ||
|
||
void NotifyDialogue::DeserializeRaw(TiltedPhoques::Buffer::Reader& aReader) noexcept | ||
{ | ||
ServerMessage::DeserializeRaw(aReader); | ||
|
||
ServerId = Serialization::ReadVarInt(aReader) & 0xFFFFFFFF; | ||
SoundFilename = Serialization::ReadString(aReader); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include "Message.h" | ||
|
||
struct NotifyDialogue final : ServerMessage | ||
{ | ||
static constexpr ServerOpcode Opcode = kNotifyDialogue; | ||
|
||
NotifyDialogue() : ServerMessage(Opcode) | ||
{ | ||
} | ||
|
||
void SerializeRaw(TiltedPhoques::Buffer::Writer& aWriter) const noexcept override; | ||
void DeserializeRaw(TiltedPhoques::Buffer::Reader& aReader) noexcept override; | ||
|
||
bool operator==(const NotifyDialogue& achRhs) const noexcept | ||
{ | ||
return GetOpcode() == achRhs.GetOpcode() && | ||
ServerId == achRhs.ServerId && | ||
SoundFilename == achRhs.SoundFilename; | ||
} | ||
|
||
uint32_t ServerId{}; | ||
TiltedPhoques::String SoundFilename{}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Would be a good place to use string cache