초기커밋
This commit is contained in:
61
GameServer/Contents/SocialAction/SocialActionCheat.cs
Normal file
61
GameServer/Contents/SocialAction/SocialActionCheat.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
[ChatCommandAttribute("socialactionall", typeof(ChatCommandSocialActionAll), AuthAdminLevelType.Developer, AuthAdminLevelType.GmNormal, AuthAdminLevelType.GmSuper)]
|
||||
internal class ChatCommandSocialActionAll : ChatCommandBase
|
||||
{
|
||||
public override async Task invoke(Player player, string token, string[] args)
|
||||
{
|
||||
var result = new Result();
|
||||
var err_msg = string.Empty;
|
||||
|
||||
var server_logic = GameServerApp.getServerLogic();
|
||||
NullReferenceCheckHelper.throwIfNull(server_logic, () => $"server_logic is null !!! - {player.toBasicString()}");
|
||||
|
||||
var social_action_load_action = player.getEntityAction<SocialActionLoadAction>();
|
||||
NullReferenceCheckHelper.throwIfNull(social_action_load_action, () => $"social_action_load_action is null !!! - {player.toBasicString()}");
|
||||
|
||||
var fn_transaction_runner = async delegate ()
|
||||
{
|
||||
var result = new Result();
|
||||
|
||||
foreach (var social_action_meta_data in MetaData.Instance._SocialActionTable.Values)
|
||||
{
|
||||
if (social_action_load_action.isOwnedSocialAction(social_action_meta_data.SocialActionId))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
await social_action_load_action.tryAddSocialActionFromMetaId(social_action_meta_data.SocialActionId);
|
||||
}
|
||||
|
||||
var batch = new QueryBatchEx<QueryRunnerWithDocument>(player, LogActionType.None, server_logic.getDynamoDbClient());
|
||||
{
|
||||
batch.addQuery(new DBQWriteToAttributeAllWithTransactionRunner());
|
||||
batch.addQuery(new QueryFinal());
|
||||
}
|
||||
|
||||
result = await QueryHelper.sendQueryAndBusinessLog(batch);
|
||||
if (result.isFail())
|
||||
{
|
||||
err_msg = $"Failed to sendQueryAndBusinessLog() !!! : {result.toBasicString()} - {player.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
player.send_S2C_NTF_OWNED_SOCIAL_ACTION();
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
result = await player.runTransactionRunnerSafely(TransactionIdType.PrivateContents, "ExchangeSocialActionSlot", fn_transaction_runner);
|
||||
if (result.isFail())
|
||||
{
|
||||
err_msg = $"Failed to runTransactionRunnerSafely() !!! : {result.toBasicString()} - {player.toBasicString()}";
|
||||
Log.getLogger().error(err_msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user