add 新增远程连接,实现多人游戏

This commit is contained in:
ZZY
2024-06-27 15:02:57 +08:00
parent d892cd6c0e
commit 9a79bef410
23 changed files with 1167 additions and 211 deletions

33
Scripts/Lib/RPMessage.cs Normal file
View File

@ -0,0 +1,33 @@
using Godot;
using Godot.Collections;
namespace RPPackage {
public class RPMessage
{
public string Type { get; set; }
public string Cmd { get; set; }
public Dictionary Data { get; set; }
public string Uid { get; set; }
public string Token { get; set; }
public string Code { get; set; }
public Dictionary ToDictionary()
{
var dict = new Dictionary();
if (Type != null)
dict.Add("type", Type);
if (Cmd != null)
dict.Add("cmd", Cmd);
if (Data != null)
dict.Add("data", Data);
if (Uid != null)
dict.Add("uid", Uid);
if (Token != null)
dict.Add("token", Token);
if (Code != null)
dict.Add("code", Code);
return dict;
}
}
}