98 lines
3.8 KiB
C#
98 lines
3.8 KiB
C#
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
|
|
namespace GameServer;
|
|
|
|
[ChatCommandAttribute("mailsetremainedtime", typeof(ChatCommandMailSetRemainedTime), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
|
internal class ChatCommandMailSetRemainedTime : ChatCommandBase
|
|
{
|
|
#pragma warning disable CS1998 // 이 비동기 메서드에는 'await' 연산자가 없으며 메서드가 동시에 실행됩니다.
|
|
public override async Task invoke(Player player, string token, string[] args)
|
|
#pragma warning restore CS1998 // 이 비동기 메서드에는 'await' 연산자가 없으며 메서드가 동시에 실행됩니다.
|
|
{
|
|
Log.getLogger().info($"HandleMailDecreaseTime");
|
|
|
|
if (args.Length < 2)
|
|
{
|
|
Log.getLogger().error($"Invalid Argument");
|
|
return;
|
|
}
|
|
|
|
// var session = ClientSessionManager.Instance.GetSession(player.HostId);
|
|
//
|
|
// if (session is null)
|
|
// {
|
|
// Log.getLogger().error($"session is null.");
|
|
// return;
|
|
// }
|
|
// try
|
|
// {
|
|
// ServerErrorCode errorCode = await session.ownedMail.SetRemainedTime(int.Parse(args[0]) == 0 ? false : true, int.Parse(args[1]));
|
|
// if (errorCode != ServerErrorCode.Success)
|
|
// {
|
|
// Log.getLogger().error($"HandleMailDecreaseTime Cheat Failed.");
|
|
// return;
|
|
// }
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// Log.getLogger().error($"{ex}");
|
|
// }
|
|
}
|
|
}
|
|
|
|
|
|
[ChatCommandAttribute("mailsendtome", typeof(ChatCommandMailSendToMe), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
|
internal class ChatCommandMailSendToMe : ChatCommandBase
|
|
{
|
|
public override async Task invoke(Player player, string token, string[] args)
|
|
{
|
|
Log.getLogger().info($"HandleMailSendToMe");
|
|
|
|
if (args.Length < 1)
|
|
{
|
|
Log.getLogger().error($"Invalid Argument");
|
|
return;
|
|
}
|
|
|
|
if (int.TryParse(args[0], out int mailCount) == false)
|
|
return;
|
|
|
|
int permanent = 0;
|
|
|
|
if (args.Length < 2 || int.TryParse(args[1], out permanent) == false)
|
|
permanent = 0;
|
|
|
|
var mail_action = player.getEntityAction<MailAction>();
|
|
NullReferenceCheckHelper.throwIfNull(mail_action, () => $"mail_action is null !!!- {player.toBasicString()}");
|
|
|
|
await mail_action.cheatSendMailToMe(mailCount, permanent == 0 ? false : true);
|
|
}
|
|
}
|
|
|
|
[ChatCommandAttribute("mailsendcountinit", typeof(ChatCommandMailSendCountInit), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
|
internal class ChatCommandMailSendCountInit : ChatCommandBase
|
|
{
|
|
public override async Task invoke(Player player, string token, string[] args)
|
|
{
|
|
Log.getLogger().info($"HandleMailSendCountInit");
|
|
|
|
var mail_action = player.getEntityAction<MailAction>();
|
|
await mail_action.CheatMailSendUpdateDay();
|
|
}
|
|
}
|
|
|
|
[ChatCommandAttribute("addsystemmail", typeof(ChatCommandAddSystemMail), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
|
internal class ChatCommandAddSystemMail : ChatCommandBase
|
|
{
|
|
public override async Task invoke(Player player, string token, string[] args)
|
|
{
|
|
Log.getLogger().info($"HandleAddSystemMail");
|
|
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
|
|
var systemMailManager = server_logic.getSystemMailManager();
|
|
await systemMailManager.CheatFuncSaveSystemMetaMail();
|
|
systemMailManager.AllPlayerSystemMailNoti();
|
|
}
|
|
} |