mirror of
https://github.com/SoDOff-Project/sodoff-mmo.git
synced 2025-10-11 16:28:50 -07:00
Merge branch 'SoDOff-Project:main' into blaster-funzones
This commit is contained in:
commit
0a6b767c62
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();
|
NetworkObject p = new();
|
||||||
NetworkArray arr = new();
|
NetworkArray arr = new();
|
||||||
NetworkObject data = new();
|
NetworkObject data = new();
|
||||||
data.Add("M", new string[] {
|
string M = receivedObject.Get<NetworkObject>("p").Get<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);
|
data.Add("MID", client.ClientID);
|
||||||
arr.Add(data);
|
arr.Add(data);
|
||||||
p.Add("arr", arr);
|
p.Add("arr", arr);
|
||||||
@ -24,7 +28,8 @@ class RacingPMHandler : CommandHandler
|
|||||||
cmd.Add("p", p);
|
cmd.Add("p", p);
|
||||||
NetworkPacket packet = NetworkObject.WrapObject(1, 13, cmd).Serialize();
|
NetworkPacket packet = NetworkObject.WrapObject(1, 13, cmd).Serialize();
|
||||||
|
|
||||||
client.Room.Send(packet);
|
if (client.Room != null) // Throws an exception in Eat my Dust when the player fires their weapon before fully in the room.
|
||||||
|
client.Room.Send(packet);
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,9 @@ public class PlayerData {
|
|||||||
"P", // position vector (older games)
|
"P", // position vector (older games)
|
||||||
"R", // rotation (older games - updated via SUV, not SPV)
|
"R", // rotation (older games - updated via SUV, not SPV)
|
||||||
"F", // flags (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)
|
// other variables (set and updated via SUV command)
|
||||||
@ -91,7 +94,8 @@ public class PlayerData {
|
|||||||
|
|
||||||
public void InitFromNetworkData(NetworkObject suvData) {
|
public void InitFromNetworkData(NetworkObject suvData) {
|
||||||
// set initial state for SPV data
|
// 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");
|
string? p1 = suvData.Get<string>("P1");
|
||||||
if (p1 != null) {
|
if (p1 != null) {
|
||||||
P1 = float.Parse(p1, CultureInfo.InvariantCulture);
|
P1 = float.Parse(p1, CultureInfo.InvariantCulture);
|
||||||
|
@ -23,11 +23,13 @@
|
|||||||
|
|
||||||
"// RoomAlerts": "List of MMO rooms with alert function. Default empty (not used by SoD), bellow sample config for WoJS, MB and SS.",
|
"// RoomAlerts": "List of MMO rooms with alert function. Default empty (not used by SoD), bellow sample config for WoJS, MB and SS.",
|
||||||
"// alert parameters": "alert type, duration [s], minimum time to start [s], maximum time to start [s], redAlertDuration (used for type '1'), number of songs (used for type '3')",
|
"// alert parameters": "alert type, duration [s], minimum time to start [s], maximum time to start [s], redAlertDuration (used for type '1'), number of songs (used for type '3')",
|
||||||
|
"// alert types": "1 - Red Alert, 2 - Disco Alert, 3 - Dance Off",
|
||||||
"RoomAlerts": {
|
"RoomAlerts": {
|
||||||
"LoungeInt" : [ ["3", 20.0, 30, 240, 0, 16] ],
|
"LoungeInt" : [ ["3", 20.0, 30, 240, 0, 16] ],
|
||||||
"Spaceport": [ ["1", 20.0, 300, 300, 60, 0], ["2", 120.0, 1800, 3600, 60, 0] ],
|
"Spaceport": [ ["1", 20.0, 300, 300, 60, 0], ["2", 120.0, 1800, 3600, 60, 0] ],
|
||||||
"Academy": [ ["1", 20.0, 300, 300, 60, 0] ],
|
"Academy": [ ["1", 20.0, 300, 300, 60, 0] ],
|
||||||
"ClubSSInt" : [ ["3", 20.0, 30, 240, 0, 16] ],
|
"ClubSSInt" : [ ["3", 20.0, 30, 240, 0, 16] ],
|
||||||
|
"JunkYardEMD": [ ["1", 20.0, 240, 300, 60, 0] ],
|
||||||
},
|
},
|
||||||
|
|
||||||
"// AmbassadorRooms": "Rooms with ambassadors (MB funzones).",
|
"// AmbassadorRooms": "Rooms with ambassadors (MB funzones).",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user