mirror of
https://github.com/SoDOff-Project/sodoff-mmo.git
synced 2025-10-11 08:18:49 -07:00
Support for Eat My Dust
Zombie Alert manager is stubbed. Added helpers to allow for weapon MMO. PlayerData for Eat My Dust
This commit is contained in:
parent
d2a11b04e2
commit
9212fd1fe4
29
src/CommandHandlers/EMDZombiesHandler.cs
Normal file
29
src/CommandHandlers/EMDZombiesHandler.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System.Globalization;
|
||||
using sodoffmmo.Attributes;
|
||||
using sodoffmmo.Core;
|
||||
using sodoffmmo.Data;
|
||||
|
||||
namespace sodoffmmo.CommandHandlers;
|
||||
|
||||
// TODO: This is currently stubbed. Supposed to do something.
|
||||
// Should probably be done by someone who actually played the game.
|
||||
[ExtensionCommandHandler("SU")]
|
||||
public class EMDZombiesUpdateHandler : CommandHandler {
|
||||
public override Task Handle(Client client, NetworkObject receivedObject) {
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
[ExtensionCommandHandler("EN")]
|
||||
public class EMDZombiesEnterHandler : CommandHandler {
|
||||
public override Task Handle(Client client, NetworkObject receivedObject) {
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
[ExtensionCommandHandler("EX")]
|
||||
public class EMDZombiesExitHandler : CommandHandler {
|
||||
public override Task Handle(Client client, NetworkObject receivedObject) {
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
@ -14,9 +14,13 @@ class RacingPMHandler : CommandHandler
|
||||
NetworkObject p = new();
|
||||
NetworkArray arr = new();
|
||||
NetworkObject data = new();
|
||||
data.Add("M", new string[] {
|
||||
receivedObject.Get<NetworkObject>("p").Get<string>("M")
|
||||
});
|
||||
string M = receivedObject.Get<NetworkObject>("p").Get<string>("M");
|
||||
if (M.StartsWith("WF:") || M.StartsWith("WFWD:")) {
|
||||
// When firing weapon in EMD, recieving clients expect userid, but the sending client sends its token instead.
|
||||
string token = M.Split(':')[1];
|
||||
M = M.Replace(token, client.PlayerData.Uid);
|
||||
}
|
||||
data.Add("M", new string[] {M});
|
||||
data.Add("MID", client.ClientID);
|
||||
arr.Add(data);
|
||||
p.Add("arr", arr);
|
||||
|
@ -57,6 +57,9 @@ public class PlayerData {
|
||||
"P", // position vector (older games)
|
||||
"R", // rotation (older games - updated via SUV, not SPV)
|
||||
"F", // flags (older games - updated via SUV, not SPV)
|
||||
"UTI", // group/clan
|
||||
"SPM", // drive mode (Eat My Dust)
|
||||
"H", // health
|
||||
};
|
||||
|
||||
// other variables (set and updated via SUV command)
|
||||
@ -91,7 +94,8 @@ public class PlayerData {
|
||||
|
||||
public void InitFromNetworkData(NetworkObject suvData) {
|
||||
// set initial state for SPV data
|
||||
R = float.Parse(suvData.Get<string>("R"), CultureInfo.InvariantCulture);
|
||||
string? r = suvData.Get<string>("R"); // in Eat My Dust, rotation is sent in R1, R2, R3
|
||||
if (r != null) R = float.Parse(r, CultureInfo.InvariantCulture);
|
||||
string? p1 = suvData.Get<string>("P1");
|
||||
if (p1 != null) {
|
||||
P1 = float.Parse(p1, CultureInfo.InvariantCulture);
|
||||
|
Loading…
x
Reference in New Issue
Block a user