mirror of
https://git.lewd.wtf/PGR/ascnet
synced 2025-12-12 19:24:36 +01:00
stage reward for item type
This commit is contained in:
@@ -91,8 +91,10 @@ namespace AscNet.GameServer.Handlers
|
||||
else
|
||||
{
|
||||
player = Player.FromToken(request.Token);
|
||||
session.log.Debug("Player is reconnecting into new session...");
|
||||
if (player is not null && (session.character is null || session.stage is null || session.inventory is null))
|
||||
{
|
||||
session.log.Debug("Reassigning player props...");
|
||||
session.character = Character.FromUid(player.PlayerData.Id);
|
||||
session.stage = Stage.FromUid(player.PlayerData.Id);
|
||||
session.inventory = Inventory.FromUid(player.PlayerData.Id);
|
||||
@@ -219,7 +221,7 @@ Sorry for the inconvenience.
|
||||
});
|
||||
|
||||
NotifyWorldChat notifyWorldChat = new();
|
||||
notifyWorldChat.ChatMessages.Add(ChatModule.MakeLuciaMessage($"Hello {session.player.PlayerData.Name}! Welcome to AscNet, please read mails if you haven't already.\n如果您还没有阅读邮件,请阅读邮件"));
|
||||
notifyWorldChat.ChatMessages.Add(ChatModule.MakeLuciaMessage($"Hello {session.player.PlayerData.Name}! Welcome to AscNet, please read mails if you haven't already.\n如果您还没有阅读邮件,请阅读邮件\n\nTry '/help' to get started"));
|
||||
|
||||
session.SendPush(notifyMails);
|
||||
session.SendPush(notifyWorldChat);
|
||||
|
||||
File diff suppressed because one or more lines are too long
26
AscNet.GameServer/Handlers/VoteModule.cs
Normal file
26
AscNet.GameServer/Handlers/VoteModule.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace AscNet.GameServer.Handlers
|
||||
{
|
||||
|
||||
#region MsgPackScheme
|
||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
[MessagePackObject(true)]
|
||||
public class GetVoteGroupListResponse
|
||||
{
|
||||
public List<dynamic> VoteGroupListCode;
|
||||
}
|
||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||
#endregion
|
||||
|
||||
internal class VoteModule
|
||||
{
|
||||
[RequestPacketHandler("GetVoteGroupListRequest")]
|
||||
public static void GetVoteGroupListRequestHandler(Session session, Packet.Request packet)
|
||||
{
|
||||
GetVoteGroupListResponse response = new();
|
||||
|
||||
session.SendResponse(response, packet.Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,12 +57,13 @@ namespace AscNet.GameServer
|
||||
while (readbytes < len)
|
||||
{
|
||||
int packetLen = BinaryPrimitives.ReadInt32LittleEndian(msg.AsSpan()[readbytes..]);
|
||||
readbytes += 4;
|
||||
if (len > 0)
|
||||
readbytes += 4;
|
||||
if (packetLen < 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if (packetLen > len)
|
||||
else if (packetLen > len && len > 0)
|
||||
{
|
||||
prevBuf += len;
|
||||
break;
|
||||
@@ -132,7 +133,7 @@ namespace AscNet.GameServer
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.Error("Failed to invoke handler: " + ex.Message + $", Raw {packet.Type} packet: " + BitConverter.ToString(debugContent).Replace("-", ""));
|
||||
log.Error("Failed to invoke handler: " + ex.ToString() + $", Raw {packet.Type} packet: " + BitConverter.ToString(debugContent).Replace("-", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user