mirror of
https://github.com/Campofinale/CampofinaleBackup.git
synced 2025-12-16 15:44:37 +00:00
commit
1c5cd8fafc
@ -1,329 +1,323 @@
|
|||||||
using System;
|
namespace Campofinale.Protocol
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Protocol
|
|
||||||
{
|
{
|
||||||
public enum CsMsgId : int
|
public enum CsMsgId : int
|
||||||
{
|
{
|
||||||
CsMessageBegin = 0,
|
CsMessageBegin = 0,
|
||||||
CsLogin = 1,
|
CsLogin = 1,
|
||||||
CsCreateRole = 2,
|
CsCreateRole = 2,
|
||||||
CsLogout = 3,
|
CsLogout = 3,
|
||||||
CsGmCommand = 4,
|
CsGmCommand = 4,
|
||||||
CsPing = 5,
|
CsPing = 5,
|
||||||
CsFlushSync = 6,
|
CsFlushSync = 6,
|
||||||
CsSetName = 7,
|
CsSetName = 7,
|
||||||
CsSetGender = 8,
|
CsSetGender = 8,
|
||||||
CsCheckName = 9,
|
CsCheckName = 9,
|
||||||
CsCheckSensitive = 10,
|
CsCheckSensitive = 10,
|
||||||
CsAchieveBegin = 20,
|
CsAchieveBegin = 20,
|
||||||
CsAchieveComplete = 21,
|
CsAchieveComplete = 21,
|
||||||
CsAchieveTakeReward = 22,
|
CsAchieveTakeReward = 22,
|
||||||
CsAchieveEnd = 29,
|
CsAchieveEnd = 29,
|
||||||
CsCharBagBegin = 30,
|
CsCharBagBegin = 30,
|
||||||
CsCharBagTeamBegin = 31,
|
CsCharBagTeamBegin = 31,
|
||||||
CsCharBagSetTeam = 32,
|
CsCharBagSetTeam = 32,
|
||||||
CsCharBagSetCurrTeamIndex = 33,
|
CsCharBagSetCurrTeamIndex = 33,
|
||||||
CsCharBagSetTeamName = 34,
|
CsCharBagSetTeamName = 34,
|
||||||
CsCharBagSetTeamLeader = 35,
|
CsCharBagSetTeamLeader = 35,
|
||||||
CsCharBagTeamChangeFinish = 36,
|
CsCharBagTeamChangeFinish = 36,
|
||||||
CsCharBagTeamEnd = 37,
|
CsCharBagTeamEnd = 37,
|
||||||
CsCharBagEnd = 39,
|
CsCharBagEnd = 39,
|
||||||
CsCharBegin = 40,
|
CsCharBegin = 40,
|
||||||
CsCharLevelUp = 41,
|
CsCharLevelUp = 41,
|
||||||
CsCharSetNormalSkill = 43,
|
CsCharSetNormalSkill = 43,
|
||||||
CsCharSkillLevelUp = 45,
|
CsCharSkillLevelUp = 45,
|
||||||
CsCharSetTeamSkill = 46,
|
CsCharSetTeamSkill = 46,
|
||||||
CsCharPotentialUnlock = 47,
|
CsCharPotentialUnlock = 47,
|
||||||
CsCharEnd = 49,
|
CsCharEnd = 49,
|
||||||
CsEquipBegin = 50,
|
CsEquipBegin = 50,
|
||||||
CsEquipPuton = 51,
|
CsEquipPuton = 51,
|
||||||
CsEquipPutoff = 52,
|
CsEquipPutoff = 52,
|
||||||
CsEquipMedicineModify = 53,
|
CsEquipMedicineModify = 53,
|
||||||
CsEquipRecycle = 54,
|
CsEquipRecycle = 54,
|
||||||
CsEquipEnhance = 55,
|
CsEquipEnhance = 55,
|
||||||
CsEquipProduce = 57,
|
CsEquipProduce = 57,
|
||||||
CsEquipEnd = 59,
|
CsEquipEnd = 59,
|
||||||
CsSceneBegin = 80,
|
CsSceneBegin = 80,
|
||||||
CsEnterScene = 81,
|
CsEnterScene = 81,
|
||||||
CsMoveObjectMove = 82,
|
CsMoveObjectMove = 82,
|
||||||
CsSceneSetLastRecordCampid = 83,
|
CsSceneSetLastRecordCampid = 83,
|
||||||
CsSceneInteractiveEventTrigger = 84,
|
CsSceneInteractiveEventTrigger = 84,
|
||||||
CsSceneSetVar = 85,
|
CsSceneSetVar = 85,
|
||||||
CsSceneRest = 86,
|
CsSceneRest = 86,
|
||||||
CsSceneLoadFinish = 88,
|
CsSceneLoadFinish = 88,
|
||||||
CsSceneSetSafeZone = 95,
|
CsSceneSetSafeZone = 95,
|
||||||
CsSceneQueryEntityExist = 96,
|
CsSceneQueryEntityExist = 96,
|
||||||
CsSceneQueryInteractiveProperty = 97,
|
CsSceneQueryInteractiveProperty = 97,
|
||||||
CsSceneSetTrackPoint = 99,
|
CsSceneSetTrackPoint = 99,
|
||||||
CsSceneInteractTree = 100,
|
CsSceneInteractTree = 100,
|
||||||
CsSceneStaticMapMarkUpdate = 101,
|
CsSceneStaticMapMarkUpdate = 101,
|
||||||
CsSceneTeleport = 103,
|
CsSceneTeleport = 103,
|
||||||
CsSceneMoveStateSet = 104,
|
CsSceneMoveStateSet = 104,
|
||||||
CsSceneSubmitItem = 105,
|
CsSceneSubmitItem = 105,
|
||||||
CsSceneSubmitEther = 106,
|
CsSceneSubmitEther = 106,
|
||||||
CsSceneSetLevelScriptActive = 107,
|
CsSceneSetLevelScriptActive = 107,
|
||||||
CsSceneLevelScriptEventTrigger = 109,
|
CsSceneLevelScriptEventTrigger = 109,
|
||||||
CsSceneCommitLevelScriptCacheStep = 110,
|
CsSceneCommitLevelScriptCacheStep = 110,
|
||||||
CsSceneRepatriate = 115,
|
CsSceneRepatriate = 115,
|
||||||
CsSceneInteractSpInteractive = 116,
|
CsSceneInteractSpInteractive = 116,
|
||||||
CsSceneSetLastSafeZone = 117,
|
CsSceneSetLastSafeZone = 117,
|
||||||
CsSceneSetBattle = 118,
|
CsSceneSetBattle = 118,
|
||||||
CsSceneRevival = 119,
|
CsSceneRevival = 119,
|
||||||
CsSceneSetLevelScriptStart = 120,
|
CsSceneSetLevelScriptStart = 120,
|
||||||
CsSceneMonsterSpawnerBeginWave = 121,
|
CsSceneMonsterSpawnerBeginWave = 121,
|
||||||
CsSceneSpawnSummon = 122,
|
CsSceneSpawnSummon = 122,
|
||||||
CsSceneLeavePlane = 123,
|
CsSceneLeavePlane = 123,
|
||||||
CsSceneGradeModify = 124,
|
CsSceneGradeModify = 124,
|
||||||
CsSceneUpdateScriptTaskProgress = 125,
|
CsSceneUpdateScriptTaskProgress = 125,
|
||||||
CsSceneTeleportFinish = 126,
|
CsSceneTeleportFinish = 126,
|
||||||
CsSceneSetStorySafeZone = 127,
|
CsSceneSetStorySafeZone = 127,
|
||||||
CsSceneSubmitRecycle = 128,
|
CsSceneSubmitRecycle = 128,
|
||||||
CsSceneEnd = 199,
|
CsSceneEnd = 199,
|
||||||
CsFactoryBegin = 200,
|
CsFactoryBegin = 200,
|
||||||
CsFactorySttUnlockNode = 201,
|
CsFactorySttUnlockNode = 201,
|
||||||
CsFactorySttUnlockLayer = 202,
|
CsFactorySttUnlockLayer = 202,
|
||||||
CsFactoryManuallyWorkExec = 211,
|
CsFactoryManuallyWorkExec = 211,
|
||||||
CsFactoryProductManualUnlock = 212,
|
CsFactoryProductManualUnlock = 212,
|
||||||
CsFactoryQuickbarSetOne = 215,
|
CsFactoryQuickbarSetOne = 215,
|
||||||
CsFactoryQuickbarMoveOne = 216,
|
CsFactoryQuickbarMoveOne = 216,
|
||||||
CsFactorySoilReclaim = 217,
|
CsFactorySoilReclaim = 217,
|
||||||
CsFactorySoilWater = 218,
|
CsFactorySoilWater = 218,
|
||||||
CsFactorySoilCancel = 219,
|
CsFactorySoilCancel = 219,
|
||||||
CsFactorySoilHarvest = 220,
|
CsFactorySoilHarvest = 220,
|
||||||
CsFactorySoilFarmlandLevelUp = 221,
|
CsFactorySoilFarmlandLevelUp = 221,
|
||||||
CsFactoryHubWorkshopMake = 222,
|
CsFactoryHubWorkshopMake = 222,
|
||||||
CsFactoryHubTransportRouteSet = 223,
|
CsFactoryHubTransportRouteSet = 223,
|
||||||
CsFactoryHubTransportRouteReset = 224,
|
CsFactoryHubTransportRouteReset = 224,
|
||||||
CsFactoryHubTransportRouteRestart = 225,
|
CsFactoryHubTransportRouteRestart = 225,
|
||||||
CsFactoryHsFb = 232,
|
CsFactoryHsFb = 232,
|
||||||
CsFactoryStatisticSetBookmarkItemIds = 234,
|
CsFactoryStatisticSetBookmarkItemIds = 234,
|
||||||
CsFactoryStatisticRequire = 235,
|
CsFactoryStatisticRequire = 235,
|
||||||
CsFactoryPinSet = 236,
|
CsFactoryPinSet = 236,
|
||||||
CsFactoryOp = 251,
|
CsFactoryOp = 251,
|
||||||
CsFactoryObserverOp = 268,
|
CsFactoryObserverOp = 268,
|
||||||
CsFactoryEnd = 269,
|
CsFactoryEnd = 269,
|
||||||
CsWeaponBegin = 270,
|
CsWeaponBegin = 270,
|
||||||
CsWeaponPuton = 271,
|
CsWeaponPuton = 271,
|
||||||
CsWeaponBreakthrough = 273,
|
CsWeaponBreakthrough = 273,
|
||||||
CsWeaponAddExp = 274,
|
CsWeaponAddExp = 274,
|
||||||
CsWeaponAttachGem = 275,
|
CsWeaponAttachGem = 275,
|
||||||
CsWeaponDetachGem = 276,
|
CsWeaponDetachGem = 276,
|
||||||
CsWeaponRefineUpgrade = 277,
|
CsWeaponRefineUpgrade = 277,
|
||||||
CsWeaponEnd = 279,
|
CsWeaponEnd = 279,
|
||||||
CsWikiBegin = 290,
|
CsWikiBegin = 290,
|
||||||
CsUnlockWiki = 291,
|
CsUnlockWiki = 291,
|
||||||
CsMarkWikiRead = 292,
|
CsMarkWikiRead = 292,
|
||||||
CsWikiEnd = 299,
|
CsWikiEnd = 299,
|
||||||
CsMissionBegin = 310,
|
CsMissionBegin = 310,
|
||||||
CsFailMission = 311,
|
CsFailMission = 311,
|
||||||
CsTrackMission = 313,
|
CsTrackMission = 313,
|
||||||
CsStopTrackingMission = 314,
|
CsStopTrackingMission = 314,
|
||||||
CsUpdateQuestObjective = 315,
|
CsUpdateQuestObjective = 315,
|
||||||
CsAcceptMission = 316,
|
CsAcceptMission = 316,
|
||||||
CsRollBlocMission = 317,
|
CsRollBlocMission = 317,
|
||||||
CsMissionEventTrigger = 318,
|
CsMissionEventTrigger = 318,
|
||||||
CsMissionClientTriggerDone = 319,
|
CsMissionClientTriggerDone = 319,
|
||||||
CsSetNewMissionTagDone = 320,
|
CsSetNewMissionTagDone = 320,
|
||||||
CsMissionEnd = 329,
|
CsMissionEnd = 329,
|
||||||
CsGuideBegin = 330,
|
CsGuideBegin = 330,
|
||||||
CsCompleteGuideGroupKeyStep = 331,
|
CsCompleteGuideGroupKeyStep = 331,
|
||||||
CsCompleteGuideGroup = 332,
|
CsCompleteGuideGroup = 332,
|
||||||
CsGuideEnd = 339,
|
CsGuideEnd = 339,
|
||||||
CsDialogBegin = 340,
|
CsDialogBegin = 340,
|
||||||
CsFinishDialog = 341,
|
CsFinishDialog = 341,
|
||||||
CsDialogEnd = 349,
|
CsDialogEnd = 349,
|
||||||
CsBlocBegin = 350,
|
CsBlocBegin = 350,
|
||||||
CsBlocTakeLevelReward = 351,
|
CsBlocTakeLevelReward = 351,
|
||||||
CsBlocShopBuy = 352,
|
CsBlocShopBuy = 352,
|
||||||
CsBlocEnd = 360,
|
CsBlocEnd = 360,
|
||||||
CsDungeonBegin = 370,
|
CsDungeonBegin = 370,
|
||||||
CsEnterDungeon = 371,
|
CsEnterDungeon = 371,
|
||||||
CsRestartDungeon = 372,
|
CsRestartDungeon = 372,
|
||||||
CsLeaveDungeon = 373,
|
CsLeaveDungeon = 373,
|
||||||
CsDungeonRecoverAp = 375,
|
CsDungeonRecoverAp = 375,
|
||||||
CsDungeonTouchEntrance = 377,
|
CsDungeonTouchEntrance = 377,
|
||||||
CsDungeonEnd = 378,
|
CsDungeonEnd = 378,
|
||||||
CsEnterTrainDungeon = 379,
|
CsEnterTrainDungeon = 379,
|
||||||
CsGameMechanicsBegin = 380,
|
CsGameMechanicsBegin = 380,
|
||||||
CsGameMechanicsReqActive = 381,
|
CsGameMechanicsReqActive = 381,
|
||||||
CsGameMechanicsReqReward = 382,
|
CsGameMechanicsReqReward = 382,
|
||||||
CsGameMechanicsNtfInstPrepareFinish = 383,
|
CsGameMechanicsNtfInstPrepareFinish = 383,
|
||||||
CsGameMechanicsEnd = 399,
|
CsGameMechanicsEnd = 399,
|
||||||
CsMailBegin = 400,
|
CsMailBegin = 400,
|
||||||
CsGetMail = 401,
|
CsGetMail = 401,
|
||||||
CsReadMail = 402,
|
CsReadMail = 402,
|
||||||
CsDeleteMail = 403,
|
CsDeleteMail = 403,
|
||||||
CsDeleteAllMail = 404,
|
CsDeleteAllMail = 404,
|
||||||
CsGetMailAttachment = 405,
|
CsGetMailAttachment = 405,
|
||||||
CsGetAllMailAttachment = 406,
|
CsGetAllMailAttachment = 406,
|
||||||
CsMarkStarMail = 407,
|
CsMarkStarMail = 407,
|
||||||
CsMailEnd = 419,
|
CsMailEnd = 419,
|
||||||
CsRedDotBegin = 430,
|
CsRedDotBegin = 430,
|
||||||
CsRemoveItemNewTags = 431,
|
CsRemoveItemNewTags = 431,
|
||||||
CsRedDotReadFormula = 432,
|
CsRedDotReadFormula = 432,
|
||||||
CsRedDotReadCharDoc = 433,
|
CsRedDotReadCharDoc = 433,
|
||||||
CsRedDotReadCharVoice = 434,
|
CsRedDotReadCharVoice = 434,
|
||||||
CsRedDotReadEquipFormula = 435,
|
CsRedDotReadEquipFormula = 435,
|
||||||
CsRedDotEnd = 440,
|
CsRedDotEnd = 440,
|
||||||
CsPrtsBegin = 441,
|
CsPrtsBegin = 441,
|
||||||
CsPrtsMarkRead = 442,
|
CsPrtsMarkRead = 442,
|
||||||
CsPrtsMarkTerminalRead = 443,
|
CsPrtsMarkTerminalRead = 443,
|
||||||
CsPrtsRichContentRead = 444,
|
CsPrtsRichContentRead = 444,
|
||||||
CsPrtsFinishInvestigate = 445,
|
CsPrtsFinishInvestigate = 445,
|
||||||
CsPrtsEnd = 449,
|
CsPrtsEnd = 449,
|
||||||
CsBitsetBegin = 480,
|
CsBitsetBegin = 480,
|
||||||
CsBitsetAdd = 481,
|
CsBitsetAdd = 481,
|
||||||
CsBitsetRemove = 482,
|
CsBitsetRemove = 482,
|
||||||
CsBitsetRemoveAll = 483,
|
CsBitsetRemoveAll = 483,
|
||||||
CsBitsetEnd = 499,
|
CsBitsetEnd = 499,
|
||||||
CsMergeMsg = 500,
|
CsMergeMsg = 500,
|
||||||
CsPayBegin = 510,
|
CsPayBegin = 510,
|
||||||
CsCreateOrder = 511,
|
CsCreateOrder = 511,
|
||||||
CsPayEnd = 529,
|
CsPayEnd = 529,
|
||||||
CsFriendBegin = 530,
|
CsFriendBegin = 530,
|
||||||
CsFriendRequestSubmit = 531,
|
CsFriendRequestSubmit = 531,
|
||||||
CsFriendRequestReject = 532,
|
CsFriendRequestReject = 532,
|
||||||
CsFriendRequestAccept = 533,
|
CsFriendRequestAccept = 533,
|
||||||
CsFriendDelete = 534,
|
CsFriendDelete = 534,
|
||||||
CsFriendSearchName = 535,
|
CsFriendSearchName = 535,
|
||||||
CsFriendRequestListSync = 536,
|
CsFriendRequestListSync = 536,
|
||||||
CsFriendListSync = 537,
|
CsFriendListSync = 537,
|
||||||
CsFriendEnd = 570,
|
CsFriendEnd = 570,
|
||||||
CsWalletBegin = 600,
|
CsWalletBegin = 600,
|
||||||
CsMoneyChange = 601,
|
CsMoneyChange = 601,
|
||||||
CsWalletEnd = 630,
|
CsWalletEnd = 630,
|
||||||
CsGameVarBegin = 631,
|
CsGameVarBegin = 631,
|
||||||
CsUpdateClientGameVar = 632,
|
CsUpdateClientGameVar = 632,
|
||||||
CsGameVarEnd = 640,
|
CsGameVarEnd = 640,
|
||||||
CsMiniGameBegin = 641,
|
CsMiniGameBegin = 641,
|
||||||
CsCompleteMiniGame = 642,
|
CsCompleteMiniGame = 642,
|
||||||
CsMiniGameEnd = 650,
|
CsMiniGameEnd = 650,
|
||||||
CsRpgDungeonBegin = 651,
|
CsRpgDungeonBegin = 651,
|
||||||
CsRpgDungeonBuy = 652,
|
CsRpgDungeonBuy = 652,
|
||||||
CsRpgDungeonSell = 653,
|
CsRpgDungeonSell = 653,
|
||||||
CsRpgDungeonEquipPuton = 654,
|
CsRpgDungeonEquipPuton = 654,
|
||||||
CsRpgDungeonEquipPutoff = 655,
|
CsRpgDungeonEquipPutoff = 655,
|
||||||
CsRpgDungeonPickLvAbility = 656,
|
CsRpgDungeonPickLvAbility = 656,
|
||||||
CsRpgDungeonTimeStop = 657,
|
CsRpgDungeonTimeStop = 657,
|
||||||
CsRpgDungeonAbilityChange = 658,
|
CsRpgDungeonAbilityChange = 658,
|
||||||
CsRpgDungeonEnd = 700,
|
CsRpgDungeonEnd = 700,
|
||||||
CsGemBegin = 801,
|
CsGemBegin = 801,
|
||||||
CsGemRecast = 802,
|
CsGemRecast = 802,
|
||||||
CsGemEnd = 820,
|
CsGemEnd = 820,
|
||||||
CsSnsBegin = 701,
|
CsSnsBegin = 701,
|
||||||
CsSnsGetList = 702,
|
CsSnsGetList = 702,
|
||||||
CsSnsMomentOption = 703,
|
CsSnsMomentOption = 703,
|
||||||
CsSnsChatDialogOption = 704,
|
CsSnsChatDialogOption = 704,
|
||||||
CsSnsMomentRead = 705,
|
CsSnsMomentRead = 705,
|
||||||
CsSnsFinishDialog = 706,
|
CsSnsFinishDialog = 706,
|
||||||
CsSnsReadDialog = 707,
|
CsSnsReadDialog = 707,
|
||||||
CsSnsEnd = 730,
|
CsSnsEnd = 730,
|
||||||
CsSpaceshipBegin = 751,
|
CsSpaceshipBegin = 751,
|
||||||
CsSpaceshipBuildRoom = 752,
|
CsSpaceshipBuildRoom = 752,
|
||||||
CsSpaceshipLevelUpRoom = 753,
|
CsSpaceshipLevelUpRoom = 753,
|
||||||
CsSpaceshipStationChar = 754,
|
CsSpaceshipStationChar = 754,
|
||||||
CsSpaceshipStationCharChangeWorkState = 755,
|
CsSpaceshipStationCharChangeWorkState = 755,
|
||||||
CsSpaceshipPresentGiftToChar = 756,
|
CsSpaceshipPresentGiftToChar = 756,
|
||||||
CsSpaceshipRecvGiftFromChar = 757,
|
CsSpaceshipRecvGiftFromChar = 757,
|
||||||
CsSpaceshipManufacturingBegin = 771,
|
CsSpaceshipManufacturingBegin = 771,
|
||||||
CsSpaceshipManufacturingStationStart = 772,
|
CsSpaceshipManufacturingStationStart = 772,
|
||||||
CsSpaceshipManufacturingStationCollect = 775,
|
CsSpaceshipManufacturingStationCollect = 775,
|
||||||
CsSpaceshipManufacturingStationCancel = 776,
|
CsSpaceshipManufacturingStationCancel = 776,
|
||||||
CsSpaceshipManufacturingStationChangeOrder = 777,
|
CsSpaceshipManufacturingStationChangeOrder = 777,
|
||||||
CsSpaceshipManufacturingEnd = 785,
|
CsSpaceshipManufacturingEnd = 785,
|
||||||
CsSpaceshipGrowCabinBegin = 786,
|
CsSpaceshipGrowCabinBegin = 786,
|
||||||
CsSpaceshipGrowCabinBreed = 787,
|
CsSpaceshipGrowCabinBreed = 787,
|
||||||
CsSpaceshipGrowCabinSow = 788,
|
CsSpaceshipGrowCabinSow = 788,
|
||||||
CsSpaceshipGrowCabinHarvest = 789,
|
CsSpaceshipGrowCabinHarvest = 789,
|
||||||
CsSpaceshipGrowCabinCancel = 790,
|
CsSpaceshipGrowCabinCancel = 790,
|
||||||
CsSpaceshipGrowCabinClearPreviewRecipe = 791,
|
CsSpaceshipGrowCabinClearPreviewRecipe = 791,
|
||||||
CsSpaceshipGrowCabinEnd = 799,
|
CsSpaceshipGrowCabinEnd = 799,
|
||||||
CsSpaceshipEnd = 800,
|
CsSpaceshipEnd = 800,
|
||||||
CsTdBegin = 821,
|
CsTdBegin = 821,
|
||||||
CsTdGetTdList = 822,
|
CsTdGetTdList = 822,
|
||||||
CsTdStart = 823,
|
CsTdStart = 823,
|
||||||
CsTdLeave = 825,
|
CsTdLeave = 825,
|
||||||
CsTdBuyBuilding = 826,
|
CsTdBuyBuilding = 826,
|
||||||
CsTdPickDropItem = 827,
|
CsTdPickDropItem = 827,
|
||||||
CsTdDropExpired = 828,
|
CsTdDropExpired = 828,
|
||||||
CsTdEnd = 899,
|
CsTdEnd = 899,
|
||||||
CsBuffBegin = 900,
|
CsBuffBegin = 900,
|
||||||
CsBattleOp = 901,
|
CsBattleOp = 901,
|
||||||
CsDevClearBattleInfo = 902,
|
CsDevClearBattleInfo = 902,
|
||||||
CsBuffEnd = 950,
|
CsBuffEnd = 950,
|
||||||
CsSkillBegin = 960,
|
CsSkillBegin = 960,
|
||||||
CsCastSkill = 961,
|
CsCastSkill = 961,
|
||||||
CsCastSkillEnd = 962,
|
CsCastSkillEnd = 962,
|
||||||
CsCastSkillEffect = 963,
|
CsCastSkillEffect = 963,
|
||||||
CsSkillEnd = 999,
|
CsSkillEnd = 999,
|
||||||
CsItemBagBegin = 1000,
|
CsItemBagBegin = 1000,
|
||||||
CsItemBagTidyInBag = 1001,
|
CsItemBagTidyInBag = 1001,
|
||||||
CsItemBagMoveInBag = 1002,
|
CsItemBagMoveInBag = 1002,
|
||||||
CsItemBagSplitInBag = 1003,
|
CsItemBagSplitInBag = 1003,
|
||||||
CsItemBagFactoryDepotToBag = 1004,
|
CsItemBagFactoryDepotToBag = 1004,
|
||||||
CsItemBagBagToFactoryDepot = 1005,
|
CsItemBagBagToFactoryDepot = 1005,
|
||||||
CsItemBagFactoryDepotToBagGrid = 1006,
|
CsItemBagFactoryDepotToBagGrid = 1006,
|
||||||
CsItemBagUseItem = 1007,
|
CsItemBagUseItem = 1007,
|
||||||
CsItemBagSetQuickBar = 1008,
|
CsItemBagSetQuickBar = 1008,
|
||||||
CsItemBagSetQuickBarPos = 1009,
|
CsItemBagSetQuickBarPos = 1009,
|
||||||
CsItemBagSetItemLock = 1010,
|
CsItemBagSetItemLock = 1010,
|
||||||
CsItemBagAbandonInBag = 1011,
|
CsItemBagAbandonInBag = 1011,
|
||||||
CsItemBagDestroyInDepot = 1012,
|
CsItemBagDestroyInDepot = 1012,
|
||||||
CsItemBagDestroyInFactoryDepot = 1013,
|
CsItemBagDestroyInFactoryDepot = 1013,
|
||||||
CsItemBagDumpBottleInBag = 1014,
|
CsItemBagDumpBottleInBag = 1014,
|
||||||
CsItemBagDumpBottleInFactoryDepot = 1015,
|
CsItemBagDumpBottleInFactoryDepot = 1015,
|
||||||
CsItemBagTakeoutLostAndFound = 1031,
|
CsItemBagTakeoutLostAndFound = 1031,
|
||||||
CsItemBagUseItemCase = 1032,
|
CsItemBagUseItemCase = 1032,
|
||||||
CsItemBagChgSpaceshipChapter = 1033,
|
CsItemBagChgSpaceshipChapter = 1033,
|
||||||
CsItemBagEnd = 1049,
|
CsItemBagEnd = 1049,
|
||||||
CsSettlementBegin = 1050,
|
CsSettlementBegin = 1050,
|
||||||
CsSettlementSelectRequire = 1051,
|
CsSettlementSelectRequire = 1051,
|
||||||
CsSettlementSetOfficer = 1052,
|
CsSettlementSetOfficer = 1052,
|
||||||
CsSettlementSetSubmitMode = 1053,
|
CsSettlementSetSubmitMode = 1053,
|
||||||
CsSettlementSubmitRequire = 1054,
|
CsSettlementSubmitRequire = 1054,
|
||||||
CsSettlementEnd = 1099,
|
CsSettlementEnd = 1099,
|
||||||
CsShopBegin = 1100,
|
CsShopBegin = 1100,
|
||||||
CsShopBuy = 1111,
|
CsShopBuy = 1111,
|
||||||
CsShopSwapMoney = 1112,
|
CsShopSwapMoney = 1112,
|
||||||
CsShopEnd = 1149,
|
CsShopEnd = 1149,
|
||||||
CsAdventureBegin = 1150,
|
CsAdventureBegin = 1150,
|
||||||
CsAdventureTakeRewardAll = 1151,
|
CsAdventureTakeRewardAll = 1151,
|
||||||
CsAdventureEnd = 1179,
|
CsAdventureEnd = 1179,
|
||||||
CsAdventureBookBegin = 1250,
|
CsAdventureBookBegin = 1250,
|
||||||
CsTakeAllAdventureTaskReward = 1251,
|
CsTakeAllAdventureTaskReward = 1251,
|
||||||
CsTakeAdventureTaskReward = 1252,
|
CsTakeAdventureTaskReward = 1252,
|
||||||
CsTakeAdventureBookStageReward = 1253,
|
CsTakeAdventureBookStageReward = 1253,
|
||||||
CsAdventureBookEnd = 1299,
|
CsAdventureBookEnd = 1299,
|
||||||
CsTalentBegin = 1300,
|
CsTalentBegin = 1300,
|
||||||
CsCharUnlockTalentNode = 1301,
|
CsCharUnlockTalentNode = 1301,
|
||||||
CsTalentEnd = 1329,
|
CsTalentEnd = 1329,
|
||||||
CsRacingDungeonBegin = 1330,
|
CsRacingDungeonBegin = 1330,
|
||||||
CsRacingDungeonBattlePassReceiveReward = 1332,
|
CsRacingDungeonBattlePassReceiveReward = 1332,
|
||||||
CsRacingDungeonGetBattlePass = 1333,
|
CsRacingDungeonGetBattlePass = 1333,
|
||||||
CsRacingDungeonGetAchievement = 1334,
|
CsRacingDungeonGetAchievement = 1334,
|
||||||
CsRacingDungeonAchievementReceiveReward = 1335,
|
CsRacingDungeonAchievementReceiveReward = 1335,
|
||||||
CsRacingDungeonLeave = 1336,
|
CsRacingDungeonLeave = 1336,
|
||||||
CsRacingDungeonUpdateBattleInfo = 1337,
|
CsRacingDungeonUpdateBattleInfo = 1337,
|
||||||
CsRacingDungeonEnd = 1400,
|
CsRacingDungeonEnd = 1400,
|
||||||
CsTrialCharacterBegin = 1401,
|
CsTrialCharacterBegin = 1401,
|
||||||
CsUseTrialCharacterEquipMedicine = 1402,
|
CsUseTrialCharacterEquipMedicine = 1402,
|
||||||
CsTrialCharacterEnd = 1403,
|
CsTrialCharacterEnd = 1403,
|
||||||
CsGachaBegin = 1431,
|
CsGachaBegin = 1431,
|
||||||
CsGachaSinglePullReq = 1432,
|
CsGachaSinglePullReq = 1432,
|
||||||
CsGachaTenPullReq = 1433,
|
CsGachaTenPullReq = 1433,
|
||||||
CsGachaEnd = 1450,
|
CsGachaEnd = 1450,
|
||||||
CsGameTimeFreezeBegin = 1451,
|
CsGameTimeFreezeBegin = 1451,
|
||||||
CsGameTimeFreezeStartReq = 1452,
|
CsGameTimeFreezeStartReq = 1452,
|
||||||
CsGameTimeFreezeEndReq = 1453,
|
CsGameTimeFreezeEndReq = 1453,
|
||||||
CsGameTimeFreezeEnd = 1460,
|
CsGameTimeFreezeEnd = 1460,
|
||||||
CsActivityBegin = 1461,
|
CsActivityBegin = 1461,
|
||||||
CsDailyCheckin = 1471,
|
CsDailyCheckin = 1471,
|
||||||
CsActivityEnd = 1510,
|
CsActivityEnd = 1510,
|
||||||
CsMessageEnd = 4095,
|
CsMessageEnd = 4095,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,401 +1,395 @@
|
|||||||
using System;
|
namespace Campofinale.Protocol
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Protocol
|
|
||||||
{
|
{
|
||||||
public enum ScMsgId : int
|
public enum ScMsgId : int
|
||||||
{
|
{
|
||||||
ScMessageBegin = 0,
|
ScMessageBegin = 0,
|
||||||
ScLogin = 1,
|
ScLogin = 1,
|
||||||
ScSyncBaseData = 2,
|
ScSyncBaseData = 2,
|
||||||
ScNtfErrorCode = 3,
|
ScNtfErrorCode = 3,
|
||||||
ScGmCommand = 4,
|
ScGmCommand = 4,
|
||||||
ScPing = 5,
|
ScPing = 5,
|
||||||
ScReconnectIncr = 6,
|
ScReconnectIncr = 6,
|
||||||
ScReconnectFull = 7,
|
ScReconnectFull = 7,
|
||||||
ScFlushSync = 8,
|
ScFlushSync = 8,
|
||||||
ScNtfCode = 9,
|
ScNtfCode = 9,
|
||||||
ScSetName = 10,
|
ScSetName = 10,
|
||||||
ScSetGender = 11,
|
ScSetGender = 11,
|
||||||
ScCheckName = 12,
|
ScCheckName = 12,
|
||||||
ScCheckSensitive = 13,
|
ScCheckSensitive = 13,
|
||||||
ScSyncFullDataEnd = 14,//
|
ScSyncFullDataEnd = 14,//
|
||||||
ScAchieveComplete = 15,
|
ScAchieveComplete = 15,
|
||||||
ScSyncAllRoleScene = 20,//
|
ScSyncAllRoleScene = 20,//
|
||||||
ScObjectEnterView = 21,
|
ScObjectEnterView = 21,
|
||||||
ScObjectLeaveView = 22,
|
ScObjectLeaveView = 22,
|
||||||
ScMoveObjectMove = 23,
|
ScMoveObjectMove = 23,
|
||||||
ScEnterSceneNotify = 24,
|
ScEnterSceneNotify = 24,
|
||||||
ScSelfSceneInfo = 25,
|
ScSelfSceneInfo = 25,
|
||||||
ScLeaveSceneNotify = 26,
|
ScLeaveSceneNotify = 26,
|
||||||
ScSceneSetLastRecordCampid = 27,
|
ScSceneSetLastRecordCampid = 27,
|
||||||
ScSceneUpdateInteractiveProperty = 28,
|
ScSceneUpdateInteractiveProperty = 28,
|
||||||
ScSceneSetVar = 29,
|
ScSceneSetVar = 29,
|
||||||
ScSceneRevival = 30,
|
ScSceneRevival = 30,
|
||||||
ScSceneCreateEntity = 31,
|
ScSceneCreateEntity = 31,
|
||||||
ScSceneDestroyEntity = 32,
|
ScSceneDestroyEntity = 32,
|
||||||
ScSceneSetSafeZone = 35,
|
ScSceneSetSafeZone = 35,
|
||||||
ScSceneQueryEntityExist = 36,
|
ScSceneQueryEntityExist = 36,
|
||||||
ScSceneLevelScriptStateNotify = 37,
|
ScSceneLevelScriptStateNotify = 37,
|
||||||
ScSceneQueryInteractiveProperty = 38,
|
ScSceneQueryInteractiveProperty = 38,
|
||||||
ScSceneUnlockArea = 39,
|
ScSceneUnlockArea = 39,
|
||||||
ScSceneSetTrackPoint = 40,
|
ScSceneSetTrackPoint = 40,
|
||||||
ScSceneCollectionSync = 42, //
|
ScSceneCollectionSync = 42, //
|
||||||
ScSceneCollectionModify = 43,
|
ScSceneCollectionModify = 43,
|
||||||
ScSceneMapMarkSync = 44,//
|
ScSceneMapMarkSync = 44,//
|
||||||
ScSceneStaticMapMarkModify = 45,
|
ScSceneStaticMapMarkModify = 45,
|
||||||
ScSceneTeleport = 46,
|
ScSceneTeleport = 46,
|
||||||
ScSceneSubmitItem = 47,
|
ScSceneSubmitItem = 47,
|
||||||
ScSceneSubmitEther = 48,
|
ScSceneSubmitEther = 48,
|
||||||
ScSceneUpdateLevelScriptProperty = 49,
|
ScSceneUpdateLevelScriptProperty = 49,
|
||||||
ScSceneResetEntity = 50,
|
ScSceneResetEntity = 50,
|
||||||
ScSceneLevelScriptResetBegin = 51,
|
ScSceneLevelScriptResetBegin = 51,
|
||||||
ScSceneLevelScriptResetEnd = 52,
|
ScSceneLevelScriptResetEnd = 52,
|
||||||
ScSceneSetBattle = 53,
|
ScSceneSetBattle = 53,
|
||||||
ScSceneLevelScriptEventTrigger = 55,
|
ScSceneLevelScriptEventTrigger = 55,
|
||||||
ScSceneInteractiveEventTrigger = 56,
|
ScSceneInteractiveEventTrigger = 56,
|
||||||
ScSceneTriggerClientLevelScriptEvent = 57,
|
ScSceneTriggerClientLevelScriptEvent = 57,
|
||||||
ScSceneTriggerClientInteractiveEvent = 58,
|
ScSceneTriggerClientInteractiveEvent = 58,
|
||||||
ScSceneCrossSceneStatus = 59,
|
ScSceneCrossSceneStatus = 59,
|
||||||
ScSceneDropCreate = 800,
|
ScSceneDropCreate = 800,
|
||||||
ScSceneDropDelete = 801,
|
ScSceneDropDelete = 801,
|
||||||
ScSceneDropModify = 802,
|
ScSceneDropModify = 802,
|
||||||
ScSceneGradeChangeNotify = 803,
|
ScSceneGradeChangeNotify = 803,
|
||||||
ScSeamlessSceneDestroyNotify = 804,
|
ScSeamlessSceneDestroyNotify = 804,
|
||||||
ScSceneMonsterSpawnerStart = 805,
|
ScSceneMonsterSpawnerStart = 805,
|
||||||
ScSceneMonsterSpawnerStop = 806,
|
ScSceneMonsterSpawnerStop = 806,
|
||||||
ScSceneMonsterSpawnerComplete = 807,
|
ScSceneMonsterSpawnerComplete = 807,
|
||||||
ScSceneMonsterSpawnerBeginWave = 808,
|
ScSceneMonsterSpawnerBeginWave = 808,
|
||||||
ScSceneMonsterSpawnerWaveComplete = 809,
|
ScSceneMonsterSpawnerWaveComplete = 809,
|
||||||
ScSceneMonsterSpawnerObjectDataBegin = 811,
|
ScSceneMonsterSpawnerObjectDataBegin = 811,
|
||||||
ScSceneMonsterSpawnerObjectDataEnd = 812,
|
ScSceneMonsterSpawnerObjectDataEnd = 812,
|
||||||
ScSceneLevelScriptTaskStateUpdate = 813,
|
ScSceneLevelScriptTaskStateUpdate = 813,
|
||||||
ScSceneClientIdInfo = 814,
|
ScSceneClientIdInfo = 814,
|
||||||
ScSceneLevelScriptTaskProgressUpdate = 815,
|
ScSceneLevelScriptTaskProgressUpdate = 815,
|
||||||
ScSceneLevelScriptTaskStartFinish = 816,
|
ScSceneLevelScriptTaskStartFinish = 816,
|
||||||
ScSceneInteractSpInteractive = 817,
|
ScSceneInteractSpInteractive = 817,
|
||||||
ScSceneUpdateInteractiveMeta = 818,
|
ScSceneUpdateInteractiveMeta = 818,
|
||||||
ScSceneGradeModify = 819,
|
ScSceneGradeModify = 819,
|
||||||
ScSceneSetStorySafeZone = 820,
|
ScSceneSetStorySafeZone = 820,
|
||||||
ScSceneRepatriate = 821,
|
ScSceneRepatriate = 821,
|
||||||
ScSceneSubmitRecycle = 822,
|
ScSceneSubmitRecycle = 822,
|
||||||
ScSceneLevelScriptSetDone = 823,
|
ScSceneLevelScriptSetDone = 823,
|
||||||
ScSyncCharBagInfo = 60,//
|
ScSyncCharBagInfo = 60,//
|
||||||
ScCharBagAddChar = 61,
|
ScCharBagAddChar = 61,
|
||||||
ScCharBagSetTeam = 62,
|
ScCharBagSetTeam = 62,
|
||||||
ScCharBagSetCurrTeamIndex = 63,
|
ScCharBagSetCurrTeamIndex = 63,
|
||||||
ScCharBagSetTeamName = 64,
|
ScCharBagSetTeamName = 64,
|
||||||
ScCharBagSetTeamLeader = 65,
|
ScCharBagSetTeamLeader = 65,
|
||||||
ScCharBagSetMaxTeamMemberCount = 66,
|
ScCharBagSetMaxTeamMemberCount = 66,
|
||||||
ScCharBagTeamLeaderNotMatchNtf = 67,
|
ScCharBagTeamLeaderNotMatchNtf = 67,
|
||||||
ScCharBagDelChar = 68,
|
ScCharBagDelChar = 68,
|
||||||
ScCharBagAddCharWithConversionNotify = 69,
|
ScCharBagAddCharWithConversionNotify = 69,
|
||||||
ScSyncWallet = 70,//
|
ScSyncWallet = 70,//
|
||||||
ScWalletSyncMoney = 71,
|
ScWalletSyncMoney = 71,
|
||||||
ScCharSkillInfos = 78,
|
ScCharSkillInfos = 78,
|
||||||
ScCharPotentialUnlock = 79,
|
ScCharPotentialUnlock = 79,
|
||||||
ScCharLevelUp = 80,
|
ScCharLevelUp = 80,
|
||||||
ScCharSyncLevelExp = 82,
|
ScCharSyncLevelExp = 82,
|
||||||
ScCharSetNormalSkill = 83,
|
ScCharSetNormalSkill = 83,
|
||||||
ScCharSkillLevelUp = 84,
|
ScCharSkillLevelUp = 84,
|
||||||
ScCharUnlockSkill = 85,
|
ScCharUnlockSkill = 85,
|
||||||
ScCharGainExpToast = 86,
|
ScCharGainExpToast = 86,
|
||||||
ScCharSyncStatus = 87,
|
ScCharSyncStatus = 87,
|
||||||
ScCharSetTeamSkill = 89,
|
ScCharSetTeamSkill = 89,
|
||||||
ScEquipPuton = 90,
|
ScEquipPuton = 90,
|
||||||
ScEquipPutoff = 91,
|
ScEquipPutoff = 91,
|
||||||
ScEquipMedicineModify = 92,
|
ScEquipMedicineModify = 92,
|
||||||
ScEquipRecycle = 93,
|
ScEquipRecycle = 93,
|
||||||
ScEquipEnhance = 94,
|
ScEquipEnhance = 94,
|
||||||
ScEquipProduce = 96,
|
ScEquipProduce = 96,
|
||||||
ScSyncAllMission = 110,//
|
ScSyncAllMission = 110,//
|
||||||
ScQuestStateUpdate = 111,
|
ScQuestStateUpdate = 111,
|
||||||
ScMissionStateUpdate = 112,
|
ScMissionStateUpdate = 112,
|
||||||
ScQuestFailed = 113,
|
ScQuestFailed = 113,
|
||||||
ScMissionFailed = 114,
|
ScMissionFailed = 114,
|
||||||
ScTrackMissionChange = 115,
|
ScTrackMissionChange = 115,
|
||||||
ScQuestObjectivesUpdate = 116,
|
ScQuestObjectivesUpdate = 116,
|
||||||
ScMissionDeleted = 117,
|
ScMissionDeleted = 117,
|
||||||
ScRollBlocMission = 120,
|
ScRollBlocMission = 120,
|
||||||
ScSyncBlocMissionInfo = 121,//
|
ScSyncBlocMissionInfo = 121,//
|
||||||
ScBlocCompletedMissionNumUpdate = 122,
|
ScBlocCompletedMissionNumUpdate = 122,
|
||||||
ScQuestRollback = 123,
|
ScQuestRollback = 123,
|
||||||
ScUpdateMissionProperty = 124,
|
ScUpdateMissionProperty = 124,
|
||||||
ScSceneTriggerClientMissionEvent = 125,
|
ScSceneTriggerClientMissionEvent = 125,
|
||||||
ScMissionEventTrigger = 126,
|
ScMissionEventTrigger = 126,
|
||||||
ScDailyMissionInfoUpdate = 127,
|
ScDailyMissionInfoUpdate = 127,
|
||||||
ScSyncAllDialog = 130,//
|
ScSyncAllDialog = 130,//
|
||||||
ScFinishDialog = 131,
|
ScFinishDialog = 131,
|
||||||
ScSyncAllGuide = 140,//
|
ScSyncAllGuide = 140,//
|
||||||
ScCompleteGuideGroupKeyStep = 141,
|
ScCompleteGuideGroupKeyStep = 141,
|
||||||
ScCompleteGuideGroup = 142,
|
ScCompleteGuideGroup = 142,
|
||||||
ScAcceptGuideGroup = 143,
|
ScAcceptGuideGroup = 143,
|
||||||
ScSyncAttr = 150,
|
ScSyncAttr = 150,
|
||||||
ScSyncAllUnlock = 160,//
|
ScSyncAllUnlock = 160,//
|
||||||
ScUnlockSystem = 161,
|
ScUnlockSystem = 161,
|
||||||
ScSyncAllBitset = 165,//
|
ScSyncAllBitset = 165,//
|
||||||
ScBitsetAdd = 166,
|
ScBitsetAdd = 166,
|
||||||
ScBitsetRemove = 167,
|
ScBitsetRemove = 167,
|
||||||
ScBitsetRemoveAll = 168,
|
ScBitsetRemoveAll = 168,
|
||||||
ScFactorySync = 200,//
|
ScFactorySync = 200,//
|
||||||
ScFactoryModifyFormulaMan = 201,
|
ScFactoryModifyFormulaMan = 201,
|
||||||
ScFactoryModifyStt = 202,
|
ScFactoryModifyStt = 202,
|
||||||
ScFactoryModifyVisibleFormula = 203,
|
ScFactoryModifyVisibleFormula = 203,
|
||||||
ScFactoryModifyFormulaMode = 204,
|
ScFactoryModifyFormulaMode = 204,
|
||||||
ScFactorySyncOfflineInfo = 205,//
|
ScFactorySyncOfflineInfo = 205,//
|
||||||
ScFactorySyncScope = 210,//
|
ScFactorySyncScope = 210,//
|
||||||
ScFactoryReleaseScope = 211,
|
ScFactoryReleaseScope = 211,
|
||||||
ScFactoryModifyScope = 212,
|
ScFactoryModifyScope = 212,
|
||||||
ScFactoryModifyQuickbar = 213,
|
ScFactoryModifyQuickbar = 213,
|
||||||
ScFactoryManuallyWorkExec = 214,
|
ScFactoryManuallyWorkExec = 214,
|
||||||
ScFactoryProductManualUnlock = 215,
|
ScFactoryProductManualUnlock = 215,
|
||||||
ScFactoryModifySoil = 216,
|
ScFactoryModifySoil = 216,
|
||||||
ScFactorySoilReclaim = 217,
|
ScFactorySoilReclaim = 217,
|
||||||
ScFactorySoilWater = 218,
|
ScFactorySoilWater = 218,
|
||||||
ScFactorySoilCancel = 219,
|
ScFactorySoilCancel = 219,
|
||||||
ScFactorySoilHarvest = 220,
|
ScFactorySoilHarvest = 220,
|
||||||
ScFactorySyncChapter = 221,//
|
ScFactorySyncChapter = 221,//
|
||||||
ScFactoryModifyChapterNodes = 222,
|
ScFactoryModifyChapterNodes = 222,
|
||||||
ScFactoryModifyChapterComponents = 223,
|
ScFactoryModifyChapterComponents = 223,
|
||||||
ScFactoryModifyChapterScene = 224,
|
ScFactoryModifyChapterScene = 224,
|
||||||
ScFactoryModifyChapterBlackboard = 225,
|
ScFactoryModifyChapterBlackboard = 225,
|
||||||
ScFactoryModifyChapterPinBoard = 226,
|
ScFactoryModifyChapterPinBoard = 226,
|
||||||
ScFactoryModifyChapterMap = 227,
|
ScFactoryModifyChapterMap = 227,
|
||||||
ScFactoryHs = 231,
|
ScFactoryHs = 231,
|
||||||
ScFactoryHsSync = 232,//
|
ScFactoryHsSync = 232,//
|
||||||
ScFactorySyncStatistic = 241,
|
ScFactorySyncStatistic = 241,
|
||||||
ScFactoryModifyStatistic = 242,
|
ScFactoryModifyStatistic = 242,
|
||||||
ScFactoryStatisticRequire = 243,
|
ScFactoryStatisticRequire = 243,
|
||||||
ScFactoryHubWorkshopMake = 244,
|
ScFactoryHubWorkshopMake = 244,
|
||||||
ScFactoryHubTransportRouteModify = 245,
|
ScFactoryHubTransportRouteModify = 245,
|
||||||
ScFactoryModifyStatisticBookmark = 246,
|
ScFactoryModifyStatisticBookmark = 246,
|
||||||
ScFactoryOpRet = 251,
|
ScFactoryOpRet = 251,
|
||||||
ScFactoryObserverRet = 259,
|
ScFactoryObserverRet = 259,
|
||||||
ScWeaponPuton = 260,
|
ScWeaponPuton = 260,
|
||||||
ScWeaponBreakthrough = 262,
|
ScWeaponBreakthrough = 262,
|
||||||
ScWeaponAddExp = 263,
|
ScWeaponAddExp = 263,
|
||||||
ScWeaponAttachGem = 264,
|
ScWeaponAttachGem = 264,
|
||||||
ScWeaponDetachGem = 265,
|
ScWeaponDetachGem = 265,
|
||||||
ScWeaponRefineUpgrade = 266,
|
ScWeaponRefineUpgrade = 266,
|
||||||
ScRewardToastBegin = 270,
|
ScRewardToastBegin = 270,
|
||||||
ScRewardToastEnd = 271,
|
ScRewardToastEnd = 271,
|
||||||
ScRewardDropMoneyToast = 272,
|
ScRewardDropMoneyToast = 272,
|
||||||
ScRewardToSceneBegin = 273,
|
ScRewardToSceneBegin = 273,
|
||||||
ScRewardToSceneEnd = 274,
|
ScRewardToSceneEnd = 274,
|
||||||
ScRewardDropSpItemToast = 275,
|
ScRewardDropSpItemToast = 275,
|
||||||
ScSyncAllBloc = 280,//
|
ScSyncAllBloc = 280,//
|
||||||
ScBlocSyncLevel = 281,
|
ScBlocSyncLevel = 281,
|
||||||
ScBlocTakeLevelReward = 282,
|
ScBlocTakeLevelReward = 282,
|
||||||
ScBlocShopBuy = 283,
|
ScBlocShopBuy = 283,
|
||||||
ScDungeonBegin = 300,
|
ScDungeonBegin = 300,
|
||||||
ScEnterDungeon = 301,
|
ScEnterDungeon = 301,
|
||||||
ScRestartDungeon = 302,
|
ScRestartDungeon = 302,
|
||||||
ScLeaveDungeon = 303,
|
ScLeaveDungeon = 303,
|
||||||
ScSyncStamina = 304,
|
ScSyncStamina = 304,
|
||||||
ScSyncFullDungeonStatus = 306,
|
ScSyncFullDungeonStatus = 306,
|
||||||
ScDungeonEnd = 359,
|
ScDungeonEnd = 359,
|
||||||
ScSyncAllMail = 400,//
|
ScSyncAllMail = 400,//
|
||||||
ScGetMail = 401,
|
ScGetMail = 401,
|
||||||
ScReadMail = 402,
|
ScReadMail = 402,
|
||||||
ScGetMailAttachment = 403,
|
ScGetMailAttachment = 403,
|
||||||
ScDelMailNotify = 404,
|
ScDelMailNotify = 404,
|
||||||
ScNewMailNotify = 405,
|
ScNewMailNotify = 405,
|
||||||
ScMarkStarMail = 406,
|
ScMarkStarMail = 406,
|
||||||
ScSyncGameMode = 430,
|
ScSyncGameMode = 430,
|
||||||
ScRemoveItemNewTags = 440,
|
ScRemoveItemNewTags = 440,
|
||||||
ScSyncAllWiki = 470,
|
ScSyncAllWiki = 470,
|
||||||
ScSyncAllStat = 500,
|
ScSyncAllStat = 500,
|
||||||
ScSyncStat = 501,
|
ScSyncStat = 501,
|
||||||
ScNewNoticeNotify = 600,
|
ScNewNoticeNotify = 600,
|
||||||
ScCreateOrder = 650,
|
ScCreateOrder = 650,
|
||||||
ScOrderMsg = 651,
|
ScOrderMsg = 651,
|
||||||
ScFriendBegin = 700,
|
ScFriendBegin = 700,
|
||||||
ScFriendRequestSubmit = 701,
|
ScFriendRequestSubmit = 701,
|
||||||
ScFriendRequestReject = 702,
|
ScFriendRequestReject = 702,
|
||||||
ScFriendRequestAccept = 703,
|
ScFriendRequestAccept = 703,
|
||||||
ScFriendDelete = 704,
|
ScFriendDelete = 704,
|
||||||
ScFriendSearchName = 705,
|
ScFriendSearchName = 705,
|
||||||
ScFriendRequestListSync = 706,
|
ScFriendRequestListSync = 706,
|
||||||
ScFriendListSync = 707,
|
ScFriendListSync = 707,
|
||||||
ScFriendRequestAddNotify = 708,
|
ScFriendRequestAddNotify = 708,
|
||||||
ScFriendAddNotify = 709,
|
ScFriendAddNotify = 709,
|
||||||
ScFriendEnd = 750,
|
ScFriendEnd = 750,
|
||||||
ScUpdateGameVar = 901,
|
ScUpdateGameVar = 901,
|
||||||
ScSyncAllGameVar = 902,//
|
ScSyncAllGameVar = 902,//
|
||||||
ScUpdateMiniGame = 913,
|
ScUpdateMiniGame = 913,
|
||||||
ScSyncAllMiniGame = 914,//
|
ScSyncAllMiniGame = 914,//
|
||||||
ScCompleteMiniGame = 915,
|
ScCompleteMiniGame = 915,
|
||||||
ScRpgDungeonBegin = 950,
|
ScRpgDungeonBegin = 950,
|
||||||
ScRpgDungeonBuy = 951,
|
ScRpgDungeonBuy = 951,
|
||||||
ScRpgDungeonSell = 952,
|
ScRpgDungeonSell = 952,
|
||||||
ScRpgDungeonEquipPuton = 953,
|
ScRpgDungeonEquipPuton = 953,
|
||||||
ScRpgDungeonEquipPutoff = 954,
|
ScRpgDungeonEquipPutoff = 954,
|
||||||
ScSyncRpgEquipColumn = 955,
|
ScSyncRpgEquipColumn = 955,
|
||||||
ScSyncRpgDungeonBuffList = 956,
|
ScSyncRpgDungeonBuffList = 956,
|
||||||
ScSyncRpgTeamLevel = 957,
|
ScSyncRpgTeamLevel = 957,
|
||||||
ScSyncRpgLevelUp = 958,
|
ScSyncRpgLevelUp = 958,
|
||||||
ScRpgDungeonPickLvAbility = 959,
|
ScRpgDungeonPickLvAbility = 959,
|
||||||
ScSyncRpgDungeonTimeInfo = 960,
|
ScSyncRpgDungeonTimeInfo = 960,
|
||||||
ScSyncRpgDungeonAbility = 961,
|
ScSyncRpgDungeonAbility = 961,
|
||||||
ScRpgDungeonEnd = 999,
|
ScRpgDungeonEnd = 999,
|
||||||
ScItemBagCommonSync = 1000,//
|
ScItemBagCommonSync = 1000,//
|
||||||
ScItemBagCommonModify = 1001,
|
ScItemBagCommonModify = 1001,
|
||||||
ScItemBagScopeSync = 1002,//
|
ScItemBagScopeSync = 1002,//
|
||||||
ScItemBagScopeModify = 1003,
|
ScItemBagScopeModify = 1003,
|
||||||
ScItemBagUseItem = 1004,
|
ScItemBagUseItem = 1004,
|
||||||
ScItemBagSetQuickBar = 1005,
|
ScItemBagSetQuickBar = 1005,
|
||||||
ScItemBagSetQuickBarPos = 1006,
|
ScItemBagSetQuickBarPos = 1006,
|
||||||
ScItemBagSetItemLock = 1007,
|
ScItemBagSetItemLock = 1007,
|
||||||
ScItemBagAbandonInBag = 1008,
|
ScItemBagAbandonInBag = 1008,
|
||||||
ScItemBagBagToFactoryDepot = 1009,
|
ScItemBagBagToFactoryDepot = 1009,
|
||||||
ScItemBagTakeoutLostAndFound = 1031,
|
ScItemBagTakeoutLostAndFound = 1031,
|
||||||
ScItemBagGotItemToast = 1032,
|
ScItemBagGotItemToast = 1032,
|
||||||
ScItemBagTrialCharDepotModify = 1033,
|
ScItemBagTrialCharDepotModify = 1033,
|
||||||
ScItemBagTrialCharDepotClear = 1034,
|
ScItemBagTrialCharDepotClear = 1034,
|
||||||
ScItemBagUseItemCase = 1035,
|
ScItemBagUseItemCase = 1035,
|
||||||
ScItemBagChgSpaceshipChapter = 1036,
|
ScItemBagChgSpaceshipChapter = 1036,
|
||||||
ScItemBagEnd = 1049,
|
ScItemBagEnd = 1049,
|
||||||
ScAddBuff = 1100,
|
ScAddBuff = 1100,
|
||||||
ScRemoveBuff = 1101,
|
ScRemoveBuff = 1101,
|
||||||
ScTriggerBuff = 1102,
|
ScTriggerBuff = 1102,
|
||||||
ScClearBuffs = 1103,
|
ScClearBuffs = 1103,
|
||||||
ScCastSkill = 1160,
|
ScCastSkill = 1160,
|
||||||
ScSyncHp = 1161,
|
ScSyncHp = 1161,
|
||||||
ScSyncPoise = 1162,
|
ScSyncPoise = 1162,
|
||||||
ScSyncUltimateSpCellCnt = 1163,
|
ScSyncUltimateSpCellCnt = 1163,
|
||||||
ScSpawnEnemy = 1170,
|
ScSpawnEnemy = 1170,
|
||||||
ScSpawnSummon = 1171,
|
ScSpawnSummon = 1171,
|
||||||
ScEntityPropertyChange = 1172,
|
ScEntityPropertyChange = 1172,
|
||||||
ScBattleDebugInfo = 1173,
|
ScBattleDebugInfo = 1173,
|
||||||
ScBattleGenerationChange = 1174,
|
ScBattleGenerationChange = 1174,
|
||||||
ScAttachServerSkill = 1175,
|
ScAttachServerSkill = 1175,
|
||||||
ScDetachServerSkill = 1176,
|
ScDetachServerSkill = 1176,
|
||||||
ScAddServerBuff = 1177,
|
ScAddServerBuff = 1177,
|
||||||
ScRemoveServerBuff = 1178,
|
ScRemoveServerBuff = 1178,
|
||||||
ScSpaceshipSync = 1200,//
|
ScSpaceshipSync = 1200,//
|
||||||
ScSpaceshipModifyRoom = 1201,
|
ScSpaceshipModifyRoom = 1201,
|
||||||
ScSpaceshipModifyChar = 1202,
|
ScSpaceshipModifyChar = 1202,
|
||||||
ScSpaceshipPresentCharInfo = 1203,
|
ScSpaceshipPresentCharInfo = 1203,
|
||||||
ScSpaceshipCharFavorabilityChange = 1204,
|
ScSpaceshipCharFavorabilityChange = 1204,
|
||||||
ScSpaceshipRecvGiftFromChar = 1205,
|
ScSpaceshipRecvGiftFromChar = 1205,
|
||||||
ScSpaceshipPresentGiftToChar = 1206,
|
ScSpaceshipPresentGiftToChar = 1206,
|
||||||
ScSpaceshipSyncRoomLevelUp = 1207,
|
ScSpaceshipSyncRoomLevelUp = 1207,
|
||||||
ScSpaceshipSyncCharSkill = 1208,
|
ScSpaceshipSyncCharSkill = 1208,
|
||||||
ScSpaceshipSyncRoomStation = 1209,
|
ScSpaceshipSyncRoomStation = 1209,
|
||||||
ScSpaceshipManufacturingStationSync = 1210,
|
ScSpaceshipManufacturingStationSync = 1210,
|
||||||
ScSpaceshipManufacturingStationStart = 1211,
|
ScSpaceshipManufacturingStationStart = 1211,
|
||||||
ScSpaceshipManufacturingStationCancel = 1212,
|
ScSpaceshipManufacturingStationCancel = 1212,
|
||||||
ScSpaceshipManufacturingStationCollect = 1213,
|
ScSpaceshipManufacturingStationCollect = 1213,
|
||||||
ScSpaceshipModifyGrowCabin = 1214,
|
ScSpaceshipModifyGrowCabin = 1214,
|
||||||
ScSpaceshipGrowCabinBreed = 1215,
|
ScSpaceshipGrowCabinBreed = 1215,
|
||||||
ScSpaceshipGrowCabinSow = 1216,
|
ScSpaceshipGrowCabinSow = 1216,
|
||||||
ScSpaceshipGrowCabinHarvest = 1217,
|
ScSpaceshipGrowCabinHarvest = 1217,
|
||||||
ScSpaceshipGrowCabinCancel = 1218,
|
ScSpaceshipGrowCabinCancel = 1218,
|
||||||
ScSpaceshipReportCharWorkModify = 1219,
|
ScSpaceshipReportCharWorkModify = 1219,
|
||||||
ScSpaceshipReportOutputModify = 1220,
|
ScSpaceshipReportOutputModify = 1220,
|
||||||
ScGameMechanicsBegin = 1250,
|
ScGameMechanicsBegin = 1250,
|
||||||
ScGameMechanicsSync = 1251,//
|
ScGameMechanicsSync = 1251,//
|
||||||
ScGameMechanicsSyncUnlockCondition = 1252,
|
ScGameMechanicsSyncUnlockCondition = 1252,
|
||||||
ScGameMechanicsModifyRecords = 1253,
|
ScGameMechanicsModifyRecords = 1253,
|
||||||
ScGameMechanicsSyncChallengeStart = 1254,
|
ScGameMechanicsSyncChallengeStart = 1254,
|
||||||
ScGameMechanicsSyncChallengeComplete = 1255,
|
ScGameMechanicsSyncChallengeComplete = 1255,
|
||||||
ScGameMechanicsSyncCompletionReward = 1256,
|
ScGameMechanicsSyncCompletionReward = 1256,
|
||||||
ScGameMechanicsSyncEnterGameInst = 1257,
|
ScGameMechanicsSyncEnterGameInst = 1257,
|
||||||
ScGameMechanicsSyncLeaveGameInst = 1258,
|
ScGameMechanicsSyncLeaveGameInst = 1258,
|
||||||
ScGameMechanicsSyncRestartGameInst = 1259,
|
ScGameMechanicsSyncRestartGameInst = 1259,
|
||||||
ScGameMechanicsModifyInstTimeFreeze = 1260,
|
ScGameMechanicsModifyInstTimeFreeze = 1260,
|
||||||
ScGameMechanicsEnd = 1299,
|
ScGameMechanicsEnd = 1299,
|
||||||
ScSnsBegin = 1300,
|
ScSnsBegin = 1300,
|
||||||
ScSnsGetMomentList = 1301,
|
ScSnsGetMomentList = 1301,
|
||||||
ScSnsGetChatList = 1302,
|
ScSnsGetChatList = 1302,
|
||||||
ScSyncSnsAddDialog = 1303,
|
ScSyncSnsAddDialog = 1303,
|
||||||
ScSnsMomentOption = 1304,
|
ScSnsMomentOption = 1304,
|
||||||
ScSyncSnsDialogModify = 1305,
|
ScSyncSnsDialogModify = 1305,
|
||||||
ScSyncSnsAddMoment = 1306,
|
ScSyncSnsAddMoment = 1306,
|
||||||
ScSnsMomentRead = 1307,
|
ScSnsMomentRead = 1307,
|
||||||
ScSnsReadDialog = 1308,
|
ScSnsReadDialog = 1308,
|
||||||
ScSyncSnsChatModify = 1309,
|
ScSyncSnsChatModify = 1309,
|
||||||
ScSnsEnd = 1330,
|
ScSnsEnd = 1330,
|
||||||
ScSettlementBegin = 1331,
|
ScSettlementBegin = 1331,
|
||||||
ScSettlementSyncAll = 1332,//
|
ScSettlementSyncAll = 1332,//
|
||||||
ScSettlementSyncModify = 1333,
|
ScSettlementSyncModify = 1333,
|
||||||
ScSettlementFinishRequires = 1334,
|
ScSettlementFinishRequires = 1334,
|
||||||
ScSettlementSetOfficer = 1335,
|
ScSettlementSetOfficer = 1335,
|
||||||
ScSettlementSelectRequire = 1336,
|
ScSettlementSelectRequire = 1336,
|
||||||
ScSettlementSetSubmitMode = 1337,
|
ScSettlementSetSubmitMode = 1337,
|
||||||
ScSettlementEnd = 1350,
|
ScSettlementEnd = 1350,
|
||||||
ScShopBegin = 1351,
|
ScShopBegin = 1351,
|
||||||
ScShopSync = 1352,//
|
ScShopSync = 1352,//
|
||||||
ScShopSyncShopGroupCondition = 1353,
|
ScShopSyncShopGroupCondition = 1353,
|
||||||
ScShopModifyShop = 1354,
|
ScShopModifyShop = 1354,
|
||||||
ScShopSyncShopCondition = 1355,
|
ScShopSyncShopCondition = 1355,
|
||||||
ScShopSyncGoodsCondition = 1356,
|
ScShopSyncGoodsCondition = 1356,
|
||||||
ScShopModifyFrequencyLimit = 1357,
|
ScShopModifyFrequencyLimit = 1357,
|
||||||
ScShopDeleteFrequencyLimit = 1358,
|
ScShopDeleteFrequencyLimit = 1358,
|
||||||
ScShopBuyResp = 1359,
|
ScShopBuyResp = 1359,
|
||||||
ScShopSwapMoney = 1360,
|
ScShopSwapMoney = 1360,
|
||||||
ScShopEnd = 1370,
|
ScShopEnd = 1370,
|
||||||
ScTdBegin = 1371,
|
ScTdBegin = 1371,
|
||||||
ScTdGetTdList = 1372,
|
ScTdGetTdList = 1372,
|
||||||
ScTdStart = 1373,
|
ScTdStart = 1373,
|
||||||
ScTdLeave = 1374,
|
ScTdLeave = 1374,
|
||||||
ScSyncTdSettlement = 1375,
|
ScSyncTdSettlement = 1375,
|
||||||
ScSyncTdFullStatus = 1376,
|
ScSyncTdFullStatus = 1376,
|
||||||
ScSyncTdDropItem = 1378,
|
ScSyncTdDropItem = 1378,
|
||||||
ScTdPickDropItem = 1379,
|
ScTdPickDropItem = 1379,
|
||||||
ScTdBuyBuilding = 1380,
|
ScTdBuyBuilding = 1380,
|
||||||
ScTdEnd = 1400,
|
ScTdEnd = 1400,
|
||||||
ScAdventureBegin = 1401,
|
ScAdventureBegin = 1401,
|
||||||
ScAdventureLevelModify = 1402,
|
ScAdventureLevelModify = 1402,
|
||||||
ScAdventureSyncAll = 1403,//
|
ScAdventureSyncAll = 1403,//
|
||||||
ScAdventureEnd = 1430,
|
ScAdventureEnd = 1430,
|
||||||
ScGemRecast = 1431,
|
ScGemRecast = 1431,
|
||||||
ScGemEnd = 1440,
|
ScGemEnd = 1440,
|
||||||
ScResetDailyAdventureTask = 1441,
|
ScResetDailyAdventureTask = 1441,
|
||||||
ScDailyActivationModify = 1443,
|
ScDailyActivationModify = 1443,
|
||||||
ScAdventureTaskModify = 1444,
|
ScAdventureTaskModify = 1444,
|
||||||
ScAdventureBookSync = 1445,//
|
ScAdventureBookSync = 1445,//
|
||||||
ScAdventureBookStageModify = 1447,
|
ScAdventureBookStageModify = 1447,
|
||||||
ScTalentBegin = 1490,
|
ScTalentBegin = 1490,
|
||||||
ScCharUnlockTalentNode = 1491,
|
ScCharUnlockTalentNode = 1491,
|
||||||
ScTalentEnd = 1529,
|
ScTalentEnd = 1529,
|
||||||
ScRacingDungeonBegin = 1530,
|
ScRacingDungeonBegin = 1530,
|
||||||
ScSyncRacingDungeonPassedLevel = 1531,
|
ScSyncRacingDungeonPassedLevel = 1531,
|
||||||
ScRacingDungeonEnter = 1532,
|
ScRacingDungeonEnter = 1532,
|
||||||
ScSyncRacingDungeonSettlement = 1533,
|
ScSyncRacingDungeonSettlement = 1533,
|
||||||
ScSyncRacingDungeonReconnect = 1534,
|
ScSyncRacingDungeonReconnect = 1534,
|
||||||
ScRacingDungeonBattlePassReceiveReward = 1535,
|
ScRacingDungeonBattlePassReceiveReward = 1535,
|
||||||
ScRacingDungeonGetBattlePass = 1536,
|
ScRacingDungeonGetBattlePass = 1536,
|
||||||
ScRacingDungeonGetAchievement = 1537,
|
ScRacingDungeonGetAchievement = 1537,
|
||||||
ScRacingDungeonAchievementReceiveReward = 1538,
|
ScRacingDungeonAchievementReceiveReward = 1538,
|
||||||
ScSyncRacingDungeonBuffModify = 1539,
|
ScSyncRacingDungeonBuffModify = 1539,
|
||||||
ScSyncRacingDungeonAchievementModify = 1540,
|
ScSyncRacingDungeonAchievementModify = 1540,
|
||||||
ScSyncRacingTimerPause = 1541,
|
ScSyncRacingTimerPause = 1541,
|
||||||
ScSyncRacingDungeonCompleteRoom = 1542,
|
ScSyncRacingDungeonCompleteRoom = 1542,
|
||||||
ScSyncRacingDungeonCountdownEvent = 1543,
|
ScSyncRacingDungeonCountdownEvent = 1543,
|
||||||
ScRacingDungeonEnd = 1600,
|
ScRacingDungeonEnd = 1600,
|
||||||
ScCharBagSetTempTeam = 1601,
|
ScCharBagSetTempTeam = 1601,
|
||||||
ScCharBagRemoveTrialCharacter = 1602,
|
ScCharBagRemoveTrialCharacter = 1602,
|
||||||
ScTrialCharacterEquipMedicineModify = 1603,
|
ScTrialCharacterEquipMedicineModify = 1603,
|
||||||
ScGachaBegin = 1610,
|
ScGachaBegin = 1610,
|
||||||
ScGachaSync = 1611,//
|
ScGachaSync = 1611,//
|
||||||
ScGachaModifyPoolInfo = 1612,
|
ScGachaModifyPoolInfo = 1612,
|
||||||
ScGachaSyncPullResult = 1613,
|
ScGachaSyncPullResult = 1613,
|
||||||
ScGachaModifyPoolRoleData = 1614,
|
ScGachaModifyPoolRoleData = 1614,
|
||||||
ScGachaEnd = 1640,
|
ScGachaEnd = 1640,
|
||||||
ScGameTimeFreezeBegin = 1641,
|
ScGameTimeFreezeBegin = 1641,
|
||||||
ScGameTimeFreezeStartRsp = 1642,
|
ScGameTimeFreezeStartRsp = 1642,
|
||||||
ScGameTimeFreezeEndRsp = 1643,
|
ScGameTimeFreezeEndRsp = 1643,
|
||||||
ScGameTimeFreezeEnd = 1650,
|
ScGameTimeFreezeEnd = 1650,
|
||||||
ScActivityBegin = 1651,
|
ScActivityBegin = 1651,
|
||||||
ScActivitySync = 1652,//
|
ScActivitySync = 1652,//
|
||||||
ScActivityModify = 1653,
|
ScActivityModify = 1653,
|
||||||
ScDailyCheckin = 1661,
|
ScDailyCheckin = 1661,
|
||||||
ScActivityEnd = 1690,
|
ScActivityEnd = 1690,
|
||||||
ScMessageEnd = 4095,
|
ScMessageEnd = 4095,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Platforms>AnyCPU;x86;ARM32</Platforms>
|
<Platforms>AnyCPU;x86;ARM32</Platforms>
|
||||||
<StartupObject>Program</StartupObject>
|
<StartupObject>Program</StartupObject>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -29,6 +30,7 @@
|
|||||||
<PackageReference Include="Pastel" Version="5.1.0" />
|
<PackageReference Include="Pastel" Version="5.1.0" />
|
||||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||||
<PackageReference Include="SQLiteNetExtensions" Version="2.1.0" />
|
<PackageReference Include="SQLiteNetExtensions" Version="2.1.0" />
|
||||||
|
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,15 +1,4 @@
|
|||||||
using Campofinale.Database;
|
namespace Campofinale.Commands
|
||||||
using Campofinale.Game.Entities;
|
|
||||||
using Campofinale.Protocol;
|
|
||||||
using Campofinale.Resource;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands
|
|
||||||
{
|
{
|
||||||
public static class BaseCommands
|
public static class BaseCommands
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,15 +1,10 @@
|
|||||||
namespace Campofinale.Commands
|
namespace Campofinale.Commands
|
||||||
{
|
{
|
||||||
using Pastel;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Net.Sockets;
|
|
||||||
using Campofinale.Protocol;
|
|
||||||
using Campofinale.Network;
|
|
||||||
|
|
||||||
public static class CommandManager
|
public static class CommandManager
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Game.Inventory;
|
using Campofinale.Game.Inventory;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
@ -28,15 +23,12 @@ public static class CommandAdd
|
|||||||
case "item":
|
case "item":
|
||||||
Item item=target.inventoryManager.AddItem(args[1], int.Parse(args[2]));
|
Item item=target.inventoryManager.AddItem(args[1], int.Parse(args[2]));
|
||||||
message = $"Item {args[1]} was added to {target.nickname}";
|
message = $"Item {args[1]} was added to {target.nickname}";
|
||||||
|
|
||||||
target.Send(new PacketScItemBagScopeModify(target, item));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "weapon":
|
case "weapon":
|
||||||
Item wep = target.inventoryManager.AddWeapon(args[1], Convert.ToUInt64(args[2]));
|
Item wep = target.inventoryManager.AddWeapon(args[1], Convert.ToUInt64(args[2]));
|
||||||
message = $"Weapon {args[1]} was added to {target.nickname}";
|
message = $"Weapon {args[1]} was added to {target.nickname}";
|
||||||
|
|
||||||
target.Send(new PacketScItemBagScopeModify(target, wep));
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "char":
|
case "char":
|
||||||
@ -77,7 +69,7 @@ public static class CommandAdd
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
target.inventoryManager.Save();
|
|
||||||
CommandManager.SendMessage(sender, $"{message}.");
|
CommandManager.SendMessage(sender, $"{message}.");
|
||||||
}
|
}
|
||||||
catch (Exception err)
|
catch (Exception err)
|
||||||
|
|||||||
@ -1,11 +1,4 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MongoDB.Bson;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using Campofinale.Game.Inventory;
|
using Campofinale.Game.Inventory;
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Campofinale.Commands.Handlers
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
|
||||||
{
|
{
|
||||||
public static class CommandClear
|
public static class CommandClear
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
using Campofinale.Game.Entities;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Packets.Sc;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Campofinale.Commands.Handlers
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
|
||||||
{
|
{
|
||||||
public static class CommandHelp
|
public static class CommandHelp
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using Campofinale.Commands;
|
using Campofinale.Commands;
|
||||||
using Campofinale.Database;
|
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ namespace Campofinale.Game.Character
|
|||||||
}
|
}
|
||||||
|
|
||||||
int updatedItemCount = 0;
|
int updatedItemCount = 0;
|
||||||
foreach (var item in target.inventoryManager.items)
|
foreach (var item in target.inventoryManager.items.items)
|
||||||
{
|
{
|
||||||
if (item.id.StartsWith("wpn_"))
|
if (item.id.StartsWith("wpn_"))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
@ -19,11 +14,6 @@ namespace Campofinale.Commands.Handlers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i < args.Length; i++)
|
|
||||||
{
|
|
||||||
args[i] = Uri.UnescapeDataString(args[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
target.nickname = string.Join(" ", args);
|
target.nickname = string.Join(" ", args);
|
||||||
target.Save();
|
target.Save();
|
||||||
target.Send(new PacketScSetName(target, target.nickname));
|
target.Send(new PacketScSetName(target, target.nickname));
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Campofinale.Commands.Handlers
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
|
||||||
{
|
{
|
||||||
public static class CommandPlayers
|
public static class CommandPlayers
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
using Campofinale.Game.Entities;
|
using Campofinale.Game.Entities;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +1,7 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
{
|
{
|
||||||
@ -23,20 +19,25 @@ namespace Campofinale.Commands.Handlers
|
|||||||
|
|
||||||
for (int i=0; i < args.Length; i++)
|
for (int i=0; i < args.Length; i++)
|
||||||
{
|
{
|
||||||
args[i] = Uri.UnescapeDataString(args[i]).Replace(".", ",");
|
args[i] = args[i].Replace(",", ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
float x, y, z;
|
float[] pos = [target.position.x, target.position.y, target.position.z];
|
||||||
|
|
||||||
x = args[0] == "~" ? target.position.x : float.Parse(args[0]);
|
for (int i=0; i < args.Length; i++) {
|
||||||
y = args[1] == "~" ? target.position.y : float.Parse(args[1]);
|
if(args[i] == "~") continue;
|
||||||
z = args[2] == "~" ? target.position.z : float.Parse(args[2]);
|
|
||||||
|
float curPos = pos[i];
|
||||||
|
pos[i] = float.Parse(args[i].StartsWith("--") ? args[i].Trim('-') : args[i], CultureInfo.InvariantCulture);
|
||||||
|
if (args[i].StartsWith('+')) pos[i] += curPos;
|
||||||
|
if (args[i].StartsWith("--")) pos[i] = curPos - pos[i];
|
||||||
|
}
|
||||||
|
|
||||||
Vector3f position = new Vector3f(new Vector()
|
Vector3f position = new Vector3f(new Vector()
|
||||||
{
|
{
|
||||||
X = x,
|
X = pos[0],
|
||||||
Y = y,
|
Y = pos[1],
|
||||||
Z = z
|
Z = pos[2]
|
||||||
});
|
});
|
||||||
|
|
||||||
target.position = position;
|
target.position = position;
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Packets.Sc;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Commands.Handlers
|
namespace Campofinale.Commands.Handlers
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Campofinale
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale
|
|
||||||
{
|
{
|
||||||
public class ConfigFile
|
public class ConfigFile
|
||||||
{
|
{
|
||||||
@ -14,30 +8,39 @@ namespace Campofinale
|
|||||||
public ServerOptions serverOptions = new();
|
public ServerOptions serverOptions = new();
|
||||||
public LogSettings logOptions = new();
|
public LogSettings logOptions = new();
|
||||||
}
|
}
|
||||||
public struct ServerOptions
|
public class ServerOptions
|
||||||
{
|
{
|
||||||
public int defaultSceneNumId = 98;
|
public int defaultSceneNumId = 87;
|
||||||
public int maxPlayers = 20;
|
public int maxPlayers = 20;
|
||||||
|
public CharactersOptions defaultCharacters = new();
|
||||||
public ServerOptions()
|
public ServerOptions()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CharactersOptions
|
||||||
|
{
|
||||||
|
public int defaultLevel = 1;
|
||||||
|
public bool giveAllCharacters = true;
|
||||||
|
public List<string> characters = new List<string>(); //used if giveAllCharacters is false
|
||||||
|
|
||||||
|
public CharactersOptions() { }
|
||||||
|
}
|
||||||
/* public struct WelcomeMail
|
/* public struct WelcomeMail
|
||||||
{
|
{
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
public struct LogSettings
|
public class LogSettings
|
||||||
{
|
{
|
||||||
public bool packets;
|
public bool packets = true;
|
||||||
public bool debugPrint=false;
|
public bool packetWarnings = true;
|
||||||
|
public bool packetBodies = false;
|
||||||
|
public bool debugPrint = false;
|
||||||
|
|
||||||
public LogSettings()
|
public LogSettings()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public struct GameserverSettings
|
public class GameserverSettings
|
||||||
{
|
{
|
||||||
public string bindAddress = "127.0.0.1";
|
public string bindAddress = "127.0.0.1";
|
||||||
public int bindPort = 30000;
|
public int bindPort = 30000;
|
||||||
@ -47,10 +50,9 @@ namespace Campofinale
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public struct DispatchServerSettings
|
public class DispatchServerSettings
|
||||||
{
|
{
|
||||||
public string bindAddress = "127.0.0.1";
|
public string bindAddress = "127.0.0.1";
|
||||||
|
|
||||||
public int bindPort = 5000;
|
public int bindPort = 5000;
|
||||||
public string accessAddress = "127.0.0.1";
|
public string accessAddress = "127.0.0.1";
|
||||||
public int accessPort = 5000;
|
public int accessPort = 5000;
|
||||||
@ -60,7 +62,7 @@ namespace Campofinale
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public struct MongoDatabaseSettings
|
public class MongoDatabaseSettings
|
||||||
{
|
{
|
||||||
public string uri = "mongodb://localhost:27017";
|
public string uri = "mongodb://localhost:27017";
|
||||||
public string collection = "Campofinale";
|
public string collection = "Campofinale";
|
||||||
|
|||||||
@ -15,9 +15,6 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Runtime.Intrinsics;
|
using System.Runtime.Intrinsics;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
|||||||
@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const url = new URL('%dispatchip%/pcSdk/console');
|
const url = new URL('%dispatchip%/pcSdk/console');
|
||||||
url.searchParams.append('command', command);
|
url.searchParams.append('command', btoa(unescape(encodeURIComponent(command))));
|
||||||
url.searchParams.append('token', token);
|
url.searchParams.append('token', token);
|
||||||
|
|
||||||
const response = await fetch(url.toString(), {
|
const response = await fetch(url.toString(), {
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
{"isInitial":true,"files":[{"index":1,"name":"VFS/CA2A581090AB4133/CA2A581090AB4133.blc","hash":"e75b8886d2426ec6b1e7f362bcd5255d","size":302,"urlPath":null,"manifest":7},{"index":2,"name":"VFS/CA2A581090AB4133/0DBA81C558A36AFC1D7D1C0A5A704A09.chk","hash":null,"size":80879438,"urlPath":null,"manifest":0},{"index":3,"name":"VFS/8F0DD938C04FD953/8F0DD938C04FD953.blc","hash":"d236d4691a5815ba973fa365ff6357f9","size":59,"urlPath":null,"manifest":3},{"index":4,"name":"VFS/16BB5AC00009A71B/16BB5AC00009A71B.blc","hash":"689374e7c7ec263dfd66fd255351fded","size":331,"urlPath":null,"manifest":3},{"index":5,"name":"VFS/16BB5AC00009A71B/6A2B02D8FCE1ED28849D1596D779CFA9.chk","hash":null,"size":14236423,"urlPath":null,"manifest":4},{"index":6,"name":"VFS/16BB5AC00009A71B/DA88C18EED8D9DEE8326BAA9AB78AA78.chk","hash":null,"size":1193655,"urlPath":null,"manifest":4},{"index":7,"name":"VFS/AAD6005BEB6AE986/AAD6005BEB6AE986.blc","hash":"51603590679e7d8590a3a1f908a38ed1","size":27360,"urlPath":null,"manifest":3},{"index":8,"name":"VFS/AAD6005BEB6AE986/1745D582258DFD069CDA135DDC740D34.chk","hash":null,"size":124467976,"urlPath":null,"manifest":4},{"index":9,"name":"VFS/B28236B7FAB03015/B28236B7FAB03015.blc","hash":"1baf1a032b9e204652eac0a7256621a7","size":15912,"urlPath":null,"manifest":7},{"index":10,"name":"VFS/B28236B7FAB03015/86BC72728AE017306E7CBE8DC67C93A9.chk","hash":null,"size":46679427,"urlPath":null,"manifest":0}],"types":null,"version":null}
|
||||||
1
Campofinale/Data/res_versions/2089329-32/ori.json
Normal file
1
Campofinale/Data/res_versions/2089329-32/ori.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
4Fmf1Xuly6yikdJUcayl2cpjWMibo8erW2rBrVmhocjKr1icY2OEppqdy1RxWomquGZ5o2R4l3BqYJ9ieHpnlZhqZaVzaaNtcWGWa2d5dZiWammQlKPFWmVSzpOqoFWeh5xtl5RvmnBvlJhmaW6Yx5uZZ8dpnZVua5LJlmxqaJnJWWKEpaDcnVtqmWJpZFXZ16OGw6afhHKnpdKeY1qgxdOgnMelq4RycK2SrVmhocjKr1icZGOEppqdy1RxWomquGZ5o2R4l3BqYJ9ieHpnlZhqZZJ2eaNwanObZ295ZpqmfXmTdm6maXxgp2d4b2OYpmdvkJWfzVplUs6TqqBVntOsos5eWdWhs5WIbG9oa5uea2maXlnXqqWAx6afWm3S2qOijlSkw6ailsulq1ptlOJjsYSbpcadsVKgZWNaocXSnFicVI2oi2horGJ7fGyXnXpmlnh7m21sX554Z3x3nZhveZJmfaZxbmOUlKObVZCHn5fVmlmcWp1imWibbGmdlphrmmNsxJlyZ5mYmGtpmcudbJVnbshxW1yIpaCymIafbG+OVKzUpImR2ppZcqHZ0aNihJ+Y0KGfldmmWXJm4ZGyWMugm8ewW2qaXlmmlNHKWXCEiH21Z2pmqHRseXaUlWdmm3Nuk3poYZx0eW10p5VnZpJreJlpe17InppaX4bNmKnKVHGEbnFpmWlrnWrHnJyZlGhqxp6dZpyYm2pomZhsZ8iWnMZaZVLZm7GdVZ6YameOVKzUpImR2ppZcqHZ0aNihJ+Y0KGfldmmWXJm4ZGyWMugm8ewW2qbXlmmlNHKWXCEiH21Z2pmqHRseXaUlWdmm3Nuk3poZqdkeWhlqJ19eadjfKZqcWiaa3tpaJ2be22Za3qoeXJeyZqiWl+GzZipylRx0K2lnJJUqqGtyYdxZ5Zkaphsa2OSVKyqn7TGq56EbKXXpKVciJ+YppzKyqqqhGxr32S0Us+gm52rhp9tYoSgmM+dW2qIiH2LYpWbeXiXc3qSaGlgn3NuaXWTqXhumnVomn1+dJ52cHx4qZ1qaJh0eKNxenKdanh5apyTmp7NVGOEoJqjzlRxpqjQ0WNY1Zuxx1pzYZdram5omZFZq9Seh8OsoVKgoKykn5CHpJfQm53Hq61SoGa0ZK6GzqWax6pZnG9lUtSTpJ1VnoeNfLVheKN8b2CWZ3l9dZqmfG+aaGajeX1mlmJsenimm3h7m2ptkJqlk4heWaCU181ZcIRnaJhobGWfYm1vbMmcm26Xa2fDa5phzGtncJSXnZyak1RjhKuiqstUcWpql5tnYoSnqc6ImqTOVHGmqNDRY1jPk6XLnp6j2lRxa7CQ4Fmf0Jac2lpzaJJUpZmgyYdxWLh4ipF5enScYmdtdamnbXena2+YZ2pnmmd7bWuWl2xupnh7km5yc6pzaGtoqKl6bZZie5VsZ5POnVlkVczGqp6EbKXXpKVciKWgspiGn2holmZtmXFwZpJUrKqftMarnoRspdekpVyIn5imnMrKqqqEbGvfZLRSz6CbnauGn3BihKCYz51baoiIfYtippdvaJVoeZl+enKWZWdpaJOnaW6UZW2kb39xqGJqaGSZk5mixVRjhKCao85UcVpkxsadZ8NiapSacpWYYmtuaJbKmJmSk26UbW9mmGOYb1WQh6qf3JdZnGluaZdkY1qo1tGHl9aaWZymrpzSXlmllNLOnZvVplmcb7Zc4VSgppfJ3Vlwk2JjhKaanctUcVqJqrhmeJRqaZVue2esc3loZpSWbGWaaHmlb2tnmGp4fWOVnGpmmHdupXp+aKp1bW92nZh4b5CVn81aZVLOk6qgVZ7TrKLOXlnVobOViGxrbmmbnmtomV5Z16qlgMemn1pt0tqjoo5UpMOmopbLpatabZTilGKEprDSnaxSoKCspJ+Qh62b1KWg0aZbatSno6Sw
|
||||||
@ -3,19 +3,12 @@ using Campofinale.Game.Character;
|
|||||||
using Campofinale.Game.Gacha;
|
using Campofinale.Game.Gacha;
|
||||||
using Campofinale.Game.Inventory;
|
using Campofinale.Game.Inventory;
|
||||||
using Campofinale.Game.Spaceship;
|
using Campofinale.Game.Spaceship;
|
||||||
using Campofinale.Resource;
|
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using MongoDB.Driver;
|
using MongoDB.Driver;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Player;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static SQLite.SQLite3;
|
|
||||||
|
|
||||||
namespace Campofinale.Database
|
namespace Campofinale.Database
|
||||||
{
|
{
|
||||||
@ -42,6 +35,8 @@ namespace Campofinale.Database
|
|||||||
public List<Scene> scenes = new();
|
public List<Scene> scenes = new();
|
||||||
public Dictionary<int, List<int>> bitsets = new();
|
public Dictionary<int, List<int>> bitsets = new();
|
||||||
public PlayerSafeZoneInfo savedSafeZone = new();
|
public PlayerSafeZoneInfo savedSafeZone = new();
|
||||||
|
public Gender gender = Gender.GenFemale;
|
||||||
|
public Dictionary<int, Item> bag = new();
|
||||||
}
|
}
|
||||||
public class Account
|
public class Account
|
||||||
{
|
{
|
||||||
@ -141,7 +136,9 @@ namespace Campofinale.Database
|
|||||||
noSpawnAnymore = player.noSpawnAnymore,
|
noSpawnAnymore = player.noSpawnAnymore,
|
||||||
scenes=player.sceneManager.scenes,
|
scenes=player.sceneManager.scenes,
|
||||||
bitsets=player.bitsetManager.bitsets,
|
bitsets=player.bitsetManager.bitsets,
|
||||||
savedSafeZone = player.savedSaveZone
|
savedSafeZone = player.savedSaveZone,
|
||||||
|
gender=player.gender,
|
||||||
|
bag=player.inventoryManager.items.bag
|
||||||
};
|
};
|
||||||
UpsertPlayerData(data);
|
UpsertPlayerData(data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
using MongoDB.Bson.Serialization.Serializers;
|
using MongoDB.Bson.Serialization;
|
||||||
using MongoDB.Bson.Serialization;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MongoDB.Bson.IO;
|
using MongoDB.Bson.IO;
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
using Campofinale.Game.Inventory;
|
||||||
|
|
||||||
namespace Campofinale.Database
|
namespace Campofinale.Database
|
||||||
{
|
{
|
||||||
@ -68,6 +63,8 @@ namespace Campofinale.Database
|
|||||||
{
|
{
|
||||||
BsonSerializer.RegisterSerializer(typeof(Dictionary<int, ulong>), new CustomDictionarySerializer<int, ulong>());
|
BsonSerializer.RegisterSerializer(typeof(Dictionary<int, ulong>), new CustomDictionarySerializer<int, ulong>());
|
||||||
BsonSerializer.RegisterSerializer(typeof(Dictionary<int, List<int>>), new CustomDictionarySerializer<int, List<int>>());
|
BsonSerializer.RegisterSerializer(typeof(Dictionary<int, List<int>>), new CustomDictionarySerializer<int, List<int>>());
|
||||||
|
BsonSerializer.RegisterSerializer(typeof(Dictionary<int, Item>), new CustomDictionarySerializer<int, Item>());
|
||||||
|
|
||||||
RegisterSubclasses<FComponent>();
|
RegisterSubclasses<FComponent>();
|
||||||
Logger.Print("Connecting to MongoDB...");
|
Logger.Print("Connecting to MongoDB...");
|
||||||
try
|
try
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game
|
namespace Campofinale.Game
|
||||||
|
|||||||
@ -6,13 +6,6 @@ using Google.Protobuf.Collections;
|
|||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using MongoDB.Bson.Serialization.IdGenerators;
|
using MongoDB.Bson.Serialization.IdGenerators;
|
||||||
using MongoDB.Driver;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static Campofinale.Resource.ResourceManager.CharGrowthTable;
|
using static Campofinale.Resource.ResourceManager.CharGrowthTable;
|
||||||
using static Campofinale.Resource.ResourceManager.WeaponUpgradeTemplateTable;
|
using static Campofinale.Resource.ResourceManager.WeaponUpgradeTemplateTable;
|
||||||
@ -149,6 +142,11 @@ namespace Campofinale.Game.Character
|
|||||||
guid = GetOwner().random.Next();
|
guid = GetOwner().random.Next();
|
||||||
this.weaponGuid = GetOwner().inventoryManager.AddWeapon(ResourceManager.charGrowthTable[id].defaultWeaponId, 1).guid;
|
this.weaponGuid = GetOwner().inventoryManager.AddWeapon(ResourceManager.charGrowthTable[id].defaultWeaponId, 1).guid;
|
||||||
this.curHp = CalcAttributes()[AttributeType.MaxHp].val;
|
this.curHp = CalcAttributes()[AttributeType.MaxHp].val;
|
||||||
|
if (level < 20) breakNode = "";
|
||||||
|
if (level >= 20 && level <= 40) breakNode = "charBreak20";
|
||||||
|
if (level > 40 && level <= 60) breakNode = "charBreak40";
|
||||||
|
if (level > 60 && level <= 70) breakNode = "charBreak60";
|
||||||
|
if (level > 70) breakNode = "charBreak70";
|
||||||
}
|
}
|
||||||
public int GetSkillMaxLevel()
|
public int GetSkillMaxLevel()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
|
|
||||||
namespace Campofinale.Game.Dungeons
|
namespace Campofinale.Game.Dungeons
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Protocol;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game.Entities
|
namespace Campofinale.Game.Entities
|
||||||
|
|||||||
@ -1,11 +1,6 @@
|
|||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game.Entities
|
namespace Campofinale.Game.Entities
|
||||||
@ -88,6 +83,7 @@ namespace Campofinale.Game.Entities
|
|||||||
|
|
||||||
Type =(int) ObjectTypeIndex.Enemy,
|
Type =(int) ObjectTypeIndex.Enemy,
|
||||||
},
|
},
|
||||||
|
|
||||||
Attrs =
|
Attrs =
|
||||||
{
|
{
|
||||||
GetAttributes()
|
GetAttributes()
|
||||||
|
|||||||
@ -1,11 +1,4 @@
|
|||||||
using Campofinale.Protocol;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using Campofinale.Resource;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
|
|
||||||
namespace Campofinale.Game.Entities
|
namespace Campofinale.Game.Entities
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,9 +1,4 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Factory.FactoryNode;
|
using static Campofinale.Game.Factory.FactoryNode;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory.Components
|
namespace Campofinale.Game.Factory.Components
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
using Campofinale.Game.Factory.Components;
|
using Campofinale.Game.Entities;
|
||||||
|
using Campofinale.Game.Factory.Components;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Numerics;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game.Factory
|
namespace Campofinale.Game.Factory
|
||||||
@ -133,8 +128,12 @@ namespace Campofinale.Game.Factory
|
|||||||
GetOwner().Send(new PacketScFactorySyncChapter(GetOwner(), chapterId));
|
GetOwner().Send(new PacketScFactorySyncChapter(GetOwner(), chapterId));
|
||||||
edit.Nodes.Add(node.ToProto());
|
edit.Nodes.Add(node.ToProto());
|
||||||
Logger.Print(Newtonsoft.Json.JsonConvert.SerializeObject(edit, Newtonsoft.Json.Formatting.Indented));
|
Logger.Print(Newtonsoft.Json.JsonConvert.SerializeObject(edit, Newtonsoft.Json.Formatting.Indented));
|
||||||
|
EntityInteractive e = new(place.TemplateId, GetOwner().roleId, new Vector3f(place.Position), new Vector3f(place.Direction), GetOwner().sceneManager.GetCurScene().sceneNumId, node.guid);
|
||||||
|
GetOwner().sceneManager.GetCurScene().entities.Add(e);
|
||||||
|
GetOwner().sceneManager.GetCurScene().SpawnEntity(e);
|
||||||
GetOwner().Send(ScMsgId.ScFactoryModifyChapterNodes, edit);
|
GetOwner().Send(ScMsgId.ScFactoryModifyChapterNodes, edit);
|
||||||
GetOwner().Send(new PacketScFactoryOpRet(GetOwner(), node.nodeId,FactoryOpType.Place),seq);
|
GetOwner().Send(new PacketScFactoryOpRet(GetOwner(), node.nodeId,FactoryOpType.Place),seq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FactoryChapter(string chapterId,ulong ownerId)
|
public FactoryChapter(string chapterId,ulong ownerId)
|
||||||
@ -266,6 +265,7 @@ namespace Campofinale.Game.Factory
|
|||||||
TemplateId=templateId,
|
TemplateId=templateId,
|
||||||
StableId= GetStableId(),
|
StableId= GetStableId(),
|
||||||
IsDeactive= deactive,
|
IsDeactive= deactive,
|
||||||
|
|
||||||
Power = new()
|
Power = new()
|
||||||
{
|
{
|
||||||
InPower= InPower(),
|
InPower= InPower(),
|
||||||
@ -289,7 +289,7 @@ namespace Campofinale.Game.Factory
|
|||||||
node.Transform.WorldRotation = direction.ToProto();
|
node.Transform.WorldRotation = direction.ToProto();
|
||||||
node.InteractiveObject = new()
|
node.InteractiveObject = new()
|
||||||
{
|
{
|
||||||
|
ObjectId=guid,
|
||||||
};
|
};
|
||||||
node.Flag = 0;
|
node.Flag = 0;
|
||||||
node.InstKey = "";
|
node.InstKey = "";
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game.Gacha
|
namespace Campofinale.Game.Gacha
|
||||||
@ -16,7 +10,7 @@ namespace Campofinale.Game.Gacha
|
|||||||
|
|
||||||
public Player player;
|
public Player player;
|
||||||
internal ulong upSeqId;
|
internal ulong upSeqId;
|
||||||
const double fiftyfifty = 0.45; // 50% (make it less than real 50, because the randomness make win fifty fifty every time
|
const double fiftyfifty = 0.50;
|
||||||
|
|
||||||
private static readonly Random random = new Random();
|
private static readonly Random random = new Random();
|
||||||
public GachaManager(Player player)
|
public GachaManager(Player player)
|
||||||
@ -176,7 +170,6 @@ namespace Campofinale.Game.Gacha
|
|||||||
RewardIds =
|
RewardIds =
|
||||||
{
|
{
|
||||||
$"reward_{transaction.rarity}starChar_weaponCoin",
|
$"reward_{transaction.rarity}starChar_weaponCoin",
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -220,11 +213,7 @@ namespace Campofinale.Game.Gacha
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int index = random.Next(0,items.Count); // Miglior randomizzazione
|
int index = random.Next(0,items.Count);
|
||||||
// index = (int)((1 - Math.Pow(random.NextDouble(), 2)) * (items.Count - 1));
|
|
||||||
|
|
||||||
// Se vuoi evitare di prendere spesso i primi 2-3 elementi:
|
|
||||||
// index = (int)Math.Pow(random.NextDouble(), 1.5) * items.Count;
|
|
||||||
if (index > items.Count-1)
|
if (index > items.Count-1)
|
||||||
{
|
{
|
||||||
index = items.Count-1;
|
index = items.Count-1;
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MongoDB.Bson.Serialization.IdGenerators;
|
using MongoDB.Bson.Serialization.IdGenerators;
|
||||||
|
|
||||||
namespace Campofinale.Game.Gacha
|
namespace Campofinale.Game.Gacha
|
||||||
|
|||||||
@ -1,16 +1,33 @@
|
|||||||
using System;
|
namespace Campofinale.Game
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Game
|
|
||||||
{
|
{
|
||||||
public static class GameConstants
|
public static class GameConstants
|
||||||
{
|
{
|
||||||
|
//TODO, have to check if this is really userful for support different platform or if android version doesn't need the GAME_VERSION_ASSET_URL (probably not?)
|
||||||
|
//So, in case is useful only if the android build it's different than 0.5.28
|
||||||
|
/*public static List<GameVersionConst> GAME_VERSIONS = new()
|
||||||
|
{
|
||||||
|
new GameVersionConst("0.5.28"), //Windows CBT2
|
||||||
|
new GameVersionConst("0.5.5"), //Android CBT2
|
||||||
|
|
||||||
|
};*/
|
||||||
|
|
||||||
|
//Not used on top ^
|
||||||
public static string GAME_VERSION = "0.5.28"; //CBT 2
|
public static string GAME_VERSION = "0.5.28"; //CBT 2
|
||||||
|
public static string GAME_VERSION_ANDROID = "0.5.5"; //CBT 2 ANDROID
|
||||||
public static string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2
|
public static string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2
|
||||||
public static int MAX_TEAMS_NUMBER = 5; //Not used yet
|
public static int MAX_TEAMS_NUMBER = 5; //Not used yet
|
||||||
public static (long, string) SERVER_UID = (99, "99"); //Not used yet, no friend chat in current Beta
|
public static (long, string) SERVER_UID = (99, "99"); //Not used yet, no friend chat in current Beta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* public class GameVersionConst
|
||||||
|
{
|
||||||
|
public string GAME_VERSION = "0.5.28";
|
||||||
|
public string GAME_VERSION_ASSET_URL = "https://beyond.hg-cdn.com/uXUuLlNbIYmMMTlN/0.5/update/6/1/Windows/0.5.28_U1mgxrslUitdn3hb/files";//CBT 2
|
||||||
|
public GameVersionConst() { }
|
||||||
|
|
||||||
|
public GameVersionConst(string version)
|
||||||
|
{
|
||||||
|
this.GAME_VERSION = version;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
272
Campofinale/Game/Inventory/InventoryList.cs
Normal file
272
Campofinale/Game/Inventory/InventoryList.cs
Normal file
@ -0,0 +1,272 @@
|
|||||||
|
using Campofinale.Database;
|
||||||
|
using Campofinale.Packets.Sc;
|
||||||
|
|
||||||
|
namespace Campofinale.Game.Inventory
|
||||||
|
{
|
||||||
|
public class InventoryList
|
||||||
|
{
|
||||||
|
public List<Item> items = new();
|
||||||
|
public Dictionary<int, Item> bag = new();
|
||||||
|
public int maxBagSize = 30;
|
||||||
|
|
||||||
|
public Player player;
|
||||||
|
public InventoryList(Player player)
|
||||||
|
{
|
||||||
|
this.player = player;
|
||||||
|
}
|
||||||
|
public enum FindType
|
||||||
|
{
|
||||||
|
Items,
|
||||||
|
FactoryDepots,
|
||||||
|
Bag
|
||||||
|
}
|
||||||
|
public void UpdateInventoryPacket()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void UpdateBagInventoryPacket()
|
||||||
|
{
|
||||||
|
player.Send(new PacketScItemBagScopeSync(this.player,Resource.ItemValuableDepotType.Invalid));
|
||||||
|
|
||||||
|
}
|
||||||
|
private void AddToBagAvailableSlot(Item item)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < maxBagSize; i++)
|
||||||
|
{
|
||||||
|
if (!bag.ContainsKey(i))
|
||||||
|
{
|
||||||
|
bag.Add(i, item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
///
|
||||||
|
///<summary>Add a item directly to the bag if there is enough space or increment current stack value</summary>
|
||||||
|
///
|
||||||
|
public bool AddToBag(Item item)
|
||||||
|
{
|
||||||
|
Item existOne = Find(i=>i.id == item.id && i.amount < item.GetItemTable().maxStackCount,FindType.Bag);
|
||||||
|
if (existOne != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(existOne.amount+item.amount > item.GetItemTable().maxStackCount)
|
||||||
|
{
|
||||||
|
int max = existOne.GetItemTable().maxStackCount;
|
||||||
|
int toAddInNewSlotAmount = existOne.amount + item.amount - max;
|
||||||
|
item.amount = toAddInNewSlotAmount;
|
||||||
|
if (SlotAvailableInBag())
|
||||||
|
{
|
||||||
|
existOne.amount = max;
|
||||||
|
AddToBagAvailableSlot(item);
|
||||||
|
UpdateBagInventoryPacket();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
existOne.amount += item.amount;
|
||||||
|
UpdateBagInventoryPacket();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(bag.Count < maxBagSize)
|
||||||
|
{
|
||||||
|
AddToBagAvailableSlot(item);
|
||||||
|
UpdateBagInventoryPacket();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool SlotAvailableInBag()
|
||||||
|
{
|
||||||
|
bool availableSlot = false;
|
||||||
|
for (int i = 0; i < maxBagSize; i++)
|
||||||
|
{
|
||||||
|
if (!bag.ContainsKey(i))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return availableSlot;
|
||||||
|
}
|
||||||
|
public Item FindInAll(Predicate<Item> match)
|
||||||
|
{
|
||||||
|
var item = items.Find(match);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
var itemB = bag.Values.ToList().Find(match);
|
||||||
|
if (itemB != null)
|
||||||
|
{
|
||||||
|
return itemB;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public Item Find(Predicate<Item> match,FindType findType = FindType.Items)
|
||||||
|
{
|
||||||
|
switch (findType)
|
||||||
|
{
|
||||||
|
case FindType.Items:
|
||||||
|
var item = items.Find(match);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case FindType.FactoryDepots:
|
||||||
|
//TODO
|
||||||
|
break;
|
||||||
|
case FindType.Bag:
|
||||||
|
var itemB = bag.Values.ToList().Find(match);
|
||||||
|
if (itemB != null)
|
||||||
|
{
|
||||||
|
return itemB;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public List<Item> FindAll(Predicate<Item> match, FindType findType = FindType.Items)
|
||||||
|
{
|
||||||
|
switch (findType)
|
||||||
|
{
|
||||||
|
case FindType.Items:
|
||||||
|
return items.FindAll(match);
|
||||||
|
break;
|
||||||
|
case FindType.FactoryDepots:
|
||||||
|
//TODO
|
||||||
|
break;
|
||||||
|
case FindType.Bag:
|
||||||
|
var itemB = bag.Values.ToList().FindAll(match);
|
||||||
|
if (itemB != null)
|
||||||
|
{
|
||||||
|
return itemB;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
///<summary>
|
||||||
|
///Add an item to the inventory (or increment it's amount if it's not an instance type, else add a new one or add to bag if it's a Factory item
|
||||||
|
///</summary>
|
||||||
|
public Item Add(Item item)
|
||||||
|
{
|
||||||
|
if (item.StorageSpace() == Resource.ItemStorageSpace.BagAndFactoryDepot)
|
||||||
|
{
|
||||||
|
AddToBag(item);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (item.InstanceType())
|
||||||
|
{
|
||||||
|
items.Add(item);
|
||||||
|
DatabaseManager.db.UpsertItem(item);
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Item exist=Find(i=>i.id==item.id);
|
||||||
|
if (exist != null)
|
||||||
|
{
|
||||||
|
exist.amount += item.amount;
|
||||||
|
DatabaseManager.db.UpsertItem(exist);
|
||||||
|
return exist;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
items.Add(item);
|
||||||
|
DatabaseManager.db.UpsertItem(item);
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Get the item amount from all depots
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int GetItemAmount(string id)
|
||||||
|
{
|
||||||
|
int amt = 0;
|
||||||
|
Item item=Find(i=>i.id==id);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
amt += item.amount;
|
||||||
|
}
|
||||||
|
List<Item> bagItems = FindAll(i=>i.id==id,FindType.Bag);
|
||||||
|
foreach (Item bagItem in bagItems)
|
||||||
|
{
|
||||||
|
amt += bagItem.amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
return amt;
|
||||||
|
}
|
||||||
|
public void Remove(Item item)
|
||||||
|
{
|
||||||
|
if (items.Remove(item))
|
||||||
|
{
|
||||||
|
this.player.Send(new PacketScItemBagScopeModify(this.player, item));
|
||||||
|
DatabaseManager.db.DeleteItem(item);
|
||||||
|
}
|
||||||
|
else if (RemoveFromBag(item))
|
||||||
|
{
|
||||||
|
UpdateBagInventoryPacket();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool RemoveFromBag(Item item)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < maxBagSize; i++)
|
||||||
|
{
|
||||||
|
Item bagItem = null;
|
||||||
|
if (bag.ContainsKey(i))
|
||||||
|
{
|
||||||
|
bagItem = bag[i];
|
||||||
|
if (bagItem.guid == item.guid)
|
||||||
|
{
|
||||||
|
bag.Remove(i);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Move item from bag grid to another position
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fromGrid"></param>
|
||||||
|
/// <param name="toGrid"></param>
|
||||||
|
public void MoveBagItem(int fromGrid, int toGrid)
|
||||||
|
{
|
||||||
|
Item item1 = bag[fromGrid];
|
||||||
|
Item item2 = null;
|
||||||
|
if (bag.ContainsKey(toGrid))
|
||||||
|
{
|
||||||
|
item2 = bag[toGrid];
|
||||||
|
}
|
||||||
|
bag[toGrid] = item1;
|
||||||
|
if (item2 != null)
|
||||||
|
{
|
||||||
|
bag[fromGrid] = item2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bag.Remove(fromGrid);
|
||||||
|
}
|
||||||
|
UpdateBagInventoryPacket();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,6 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Resource;
|
|
||||||
using Google.Protobuf.Collections;
|
using Google.Protobuf.Collections;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Game.Inventory
|
namespace Campofinale.Game.Inventory
|
||||||
@ -15,7 +8,7 @@ namespace Campofinale.Game.Inventory
|
|||||||
public class InventoryManager
|
public class InventoryManager
|
||||||
{
|
{
|
||||||
public Player owner;
|
public Player owner;
|
||||||
public List<Item> items= new List<Item>();
|
public InventoryList items;
|
||||||
|
|
||||||
public int item_diamond_amt
|
public int item_diamond_amt
|
||||||
{
|
{
|
||||||
@ -36,12 +29,12 @@ namespace Campofinale.Game.Inventory
|
|||||||
|
|
||||||
public Item GetItemById(string id)
|
public Item GetItemById(string id)
|
||||||
{
|
{
|
||||||
return items.Find(i => i.id == id);
|
return items.FindInAll(i => i.id == id);
|
||||||
}
|
}
|
||||||
public InventoryManager(Player o) {
|
public InventoryManager(Player o) {
|
||||||
|
|
||||||
owner = o;
|
owner = o;
|
||||||
|
items=new(o);
|
||||||
}
|
}
|
||||||
public void AddRewards(string rewardTemplateId, Vector3f pos, int sourceType=1)
|
public void AddRewards(string rewardTemplateId, Vector3f pos, int sourceType=1)
|
||||||
{
|
{
|
||||||
@ -110,46 +103,25 @@ namespace Campofinale.Game.Inventory
|
|||||||
}
|
}
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
foreach (Item item in items)
|
foreach (Item item in items.items)
|
||||||
{
|
{
|
||||||
DatabaseManager.db.UpsertItem(item);
|
DatabaseManager.db.UpsertItem(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Load()
|
public void Load()
|
||||||
{
|
{
|
||||||
items = DatabaseManager.db.LoadInventoryItems(owner.roleId);
|
items.items = DatabaseManager.db.LoadInventoryItems(owner.roleId);
|
||||||
}
|
}
|
||||||
public Item AddItem(string id, int amt)
|
public Item AddItem(string id, int amt, bool notify=false)
|
||||||
{
|
{
|
||||||
Item it = new()
|
Item item = new Item(owner.roleId, id, amt);
|
||||||
{
|
|
||||||
id = id,
|
|
||||||
};
|
|
||||||
if(!it.InstanceType())
|
|
||||||
{
|
|
||||||
|
|
||||||
Item item = items.Find(i=>i.id == id);
|
Item itemNew = items.Add(item);
|
||||||
if (item != null)
|
if (notify && itemNew != null)
|
||||||
{
|
|
||||||
// Logger.Print(id + ": " + amt+" added to existing");
|
|
||||||
item.amount += amt;
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Logger.Print(id + ": " + amt + " added to new");
|
|
||||||
item = new Item(owner.roleId, id, amt);
|
|
||||||
items.Add(item);
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
//Logger.Print(id + ": " + amt + " added to new as instance");
|
this.owner.Send(new PacketScItemBagScopeModify(this.owner, itemNew));
|
||||||
Item item = new Item(owner.roleId, id, amt);
|
|
||||||
items.Add(item);
|
|
||||||
return item;
|
|
||||||
}
|
}
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
public void RemoveItem(Item item,int amt)
|
public void RemoveItem(Item item,int amt)
|
||||||
{
|
{
|
||||||
@ -157,9 +129,46 @@ namespace Campofinale.Game.Inventory
|
|||||||
if(item.amount <= 0)
|
if(item.amount <= 0)
|
||||||
{
|
{
|
||||||
items.Remove(item);
|
items.Remove(item);
|
||||||
DatabaseManager.db.DeleteItem(item);
|
|
||||||
}
|
}
|
||||||
this.owner.Send(new PacketScItemBagScopeModify(this.owner, item));
|
else
|
||||||
|
{
|
||||||
|
this.owner.Send(new PacketScItemBagScopeModify(this.owner, item));
|
||||||
|
items.UpdateBagInventoryPacket();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ConsumeItem(string id, int amt)
|
||||||
|
{
|
||||||
|
Item item=items.FindInAll(i=>i.id== id);
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
if(item.amount >= amt)
|
||||||
|
{
|
||||||
|
item.amount -= amt;
|
||||||
|
|
||||||
|
if(item.amount < 1)
|
||||||
|
{
|
||||||
|
items.Remove(item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.owner.Send(new PacketScItemBagScopeModify(this.owner, item));
|
||||||
|
items.UpdateBagInventoryPacket();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int toConsume = amt - item.amount;
|
||||||
|
item.amount = 0;
|
||||||
|
items.Remove(item);
|
||||||
|
return ConsumeItem(id, toConsume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public bool ConsumeItems(MapField<string, ulong> costItemId2Count)
|
public bool ConsumeItems(MapField<string, ulong> costItemId2Count)
|
||||||
{
|
{
|
||||||
@ -179,16 +188,8 @@ namespace Campofinale.Game.Inventory
|
|||||||
bool found = true;
|
bool found = true;
|
||||||
foreach (ItemInfo item in items)
|
foreach (ItemInfo item in items)
|
||||||
{
|
{
|
||||||
Item i= GetItemById(item.ResId);
|
int amount = this.items.GetItemAmount(item.ResId);
|
||||||
if (i != null)
|
if(amount < item.ResCount)
|
||||||
{
|
|
||||||
if(i.amount < item.ResCount)
|
|
||||||
{
|
|
||||||
found = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
break;
|
break;
|
||||||
@ -196,14 +197,7 @@ namespace Campofinale.Game.Inventory
|
|||||||
}
|
}
|
||||||
foreach (ItemInfo item in items)
|
foreach (ItemInfo item in items)
|
||||||
{
|
{
|
||||||
Item i = GetItemById(item.ResId);
|
ConsumeItem(item.ResId, item.ResCount);
|
||||||
if (i != null)
|
|
||||||
{
|
|
||||||
if (i.amount >= item.ResCount)
|
|
||||||
{
|
|
||||||
RemoveItem(i,item.ResCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
@ -211,13 +205,37 @@ namespace Campofinale.Game.Inventory
|
|||||||
public Dictionary<uint, int> GetInventoryChapter(string chapterId)
|
public Dictionary<uint, int> GetInventoryChapter(string chapterId)
|
||||||
{
|
{
|
||||||
Dictionary<uint, int> dir= new Dictionary<uint, int>();
|
Dictionary<uint, int> dir= new Dictionary<uint, int>();
|
||||||
List<Item> citems = items.FindAll(i=>!i.InstanceType());
|
/*List<Item> citems = items.FindAll(i=>!i.InstanceType());
|
||||||
foreach (Item item in citems)
|
foreach (Item item in citems)
|
||||||
{
|
{
|
||||||
dir.Add((uint)ResourceManager.strIdNumTable.item_id.dic[item.id], item.amount);
|
dir.Add((uint)ResourceManager.strIdNumTable.item_id.dic[item.id], item.amount);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DropItemsBag(CsItemBagAbandonInBag req)
|
||||||
|
{
|
||||||
|
if(req.TargetObjectId == 0)
|
||||||
|
{
|
||||||
|
foreach (var i in req.GridCut)
|
||||||
|
{
|
||||||
|
Item item = items.bag[i.Key];
|
||||||
|
item.amount -= i.Value;
|
||||||
|
if(item.amount <= 0)
|
||||||
|
{
|
||||||
|
items.bag.Remove(i.Key);
|
||||||
|
}
|
||||||
|
owner.sceneManager.CreateDrop(owner.position, new RewardTable.ItemBundle()
|
||||||
|
{
|
||||||
|
count=i.Value,
|
||||||
|
id=item.id,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
items.UpdateBagInventoryPacket();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,6 +48,10 @@ namespace Campofinale.Game.Inventory
|
|||||||
this.level = level;
|
this.level = level;
|
||||||
guid = GetOwner().random.Next();
|
guid = GetOwner().random.Next();
|
||||||
}
|
}
|
||||||
|
public ItemStorageSpace StorageSpace()
|
||||||
|
{
|
||||||
|
return ResourceManager.itemTypeTable[GetItemTable().type].storageSpace;
|
||||||
|
}
|
||||||
public ulong GetDefaultLevel()
|
public ulong GetDefaultLevel()
|
||||||
{
|
{
|
||||||
switch (ItemType)
|
switch (ItemType)
|
||||||
@ -68,10 +72,15 @@ namespace Campofinale.Game.Inventory
|
|||||||
}
|
}
|
||||||
public ItemValuableDepotType ItemType
|
public ItemValuableDepotType ItemType
|
||||||
{
|
{
|
||||||
get{
|
get
|
||||||
|
{
|
||||||
return ResourceManager.GetItemTable(id).valuableTabType;
|
return ResourceManager.GetItemTable(id).valuableTabType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public ItemTable GetItemTable()
|
||||||
|
{
|
||||||
|
return ResourceManager.GetItemTable(id);
|
||||||
|
}
|
||||||
public virtual ScdItemGrid ToProto()
|
public virtual ScdItemGrid ToProto()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -1,11 +1,6 @@
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MongoDB.Bson.Serialization.IdGenerators;
|
using MongoDB.Bson.Serialization.IdGenerators;
|
||||||
|
|
||||||
namespace Campofinale.Game
|
namespace Campofinale.Game
|
||||||
|
|||||||
252
Campofinale/Game/MissionSys/MissionSystem.cs
Normal file
252
Campofinale/Game/MissionSys/MissionSystem.cs
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
using Campofinale.Database;
|
||||||
|
using Campofinale.Protocol;
|
||||||
|
using Campofinale.Resource;
|
||||||
|
using Campofinale.Resource.Table;
|
||||||
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||||
|
|
||||||
|
namespace Campofinale.Game.MissionSys
|
||||||
|
{
|
||||||
|
public class MissionSystem
|
||||||
|
{
|
||||||
|
public Player owner;
|
||||||
|
public List<GameMission> missions=new();
|
||||||
|
public List<GameQuest> quests=new();
|
||||||
|
public string curMission = "e0m0";
|
||||||
|
|
||||||
|
public MissionSystem(Player o)
|
||||||
|
{
|
||||||
|
owner = o;
|
||||||
|
}
|
||||||
|
public ScSyncAllMission ToProto()
|
||||||
|
{
|
||||||
|
ScSyncAllMission sync = new ScSyncAllMission();
|
||||||
|
sync.TrackMissionId = curMission;
|
||||||
|
missions.ForEach(m =>
|
||||||
|
{
|
||||||
|
sync.Missions.Add(m.missionId, new Mission()
|
||||||
|
{
|
||||||
|
MissionId = m.missionId,
|
||||||
|
MissionState = (int)m.state,
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
quests.ForEach(q =>
|
||||||
|
{
|
||||||
|
Quest quest=new Quest()
|
||||||
|
{
|
||||||
|
QuestId = q.questId,
|
||||||
|
QuestState = (int)q.state,
|
||||||
|
|
||||||
|
};
|
||||||
|
var data = GetQuestData(q.questId);
|
||||||
|
data.objectiveList.ForEach(o =>
|
||||||
|
{
|
||||||
|
quest.QuestObjectives.Add(new QuestObjective()
|
||||||
|
{
|
||||||
|
ConditionId = o.condition.uniqueId,
|
||||||
|
Values =
|
||||||
|
{
|
||||||
|
{o.condition.uniqueId,0 }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
sync.CurQuests.Add(q.questId, quest);
|
||||||
|
|
||||||
|
});
|
||||||
|
return sync;
|
||||||
|
}
|
||||||
|
public MissionDataTable.QuestInfo GetQuestData(string id)
|
||||||
|
{
|
||||||
|
MissionDataTable.QuestInfo quest = null;
|
||||||
|
foreach(MissionDataTable m in ResourceManager.missionDataTable)
|
||||||
|
{
|
||||||
|
if(m.questDic.TryGetValue(id, out quest))
|
||||||
|
{
|
||||||
|
return quest;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return quest;
|
||||||
|
}
|
||||||
|
public void Save()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public void Load()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (ResourceManager.missionDataTable.Count < 1)
|
||||||
|
{
|
||||||
|
//Disabling if no missions
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//TODO Saving and first initialization
|
||||||
|
AddMission("e0m0",MissionState.Processing);
|
||||||
|
}
|
||||||
|
public void AddMission(string id,MissionState state = MissionState.Available, bool notify=false)
|
||||||
|
{
|
||||||
|
MissionDataTable data = ResourceManager.missionDataTable.Find(m=>m.missionId == id);
|
||||||
|
if (data != null)
|
||||||
|
{
|
||||||
|
missions.Add(new GameMission(id, state));
|
||||||
|
if (notify)
|
||||||
|
{
|
||||||
|
ScMissionStateUpdate s = new()
|
||||||
|
{
|
||||||
|
MissionId = data.missionId,
|
||||||
|
MissionState = (int)state,
|
||||||
|
SucceedId=-1,
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
foreach (var q in data.questDic.Values)
|
||||||
|
{
|
||||||
|
AddQuest(q, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public GameQuest GetQuestById(string id)
|
||||||
|
{
|
||||||
|
return quests.Find(q => q.questId == id);
|
||||||
|
}
|
||||||
|
public void AddQuest(MissionDataTable.QuestInfo data,bool notify=false)
|
||||||
|
{
|
||||||
|
GameQuest quest = GetQuestById(data.questId);
|
||||||
|
if (quest == null)
|
||||||
|
{
|
||||||
|
quest = new GameQuest(data.questId);
|
||||||
|
quest.state = QuestState.Available;
|
||||||
|
if (notify)
|
||||||
|
{
|
||||||
|
ScQuestObjectivesUpdate upd = new()
|
||||||
|
{
|
||||||
|
QuestId = data.questId,
|
||||||
|
|
||||||
|
};
|
||||||
|
data.objectiveList.ForEach(o =>
|
||||||
|
{
|
||||||
|
upd.QuestObjectives.Add(new QuestObjective()
|
||||||
|
{
|
||||||
|
ConditionId=o.condition.uniqueId,
|
||||||
|
Values =
|
||||||
|
{
|
||||||
|
{o.condition.uniqueId,0 }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
ScQuestStateUpdate update = new()
|
||||||
|
{
|
||||||
|
QuestId = quest.questId,
|
||||||
|
QuestState = (int)quest.state,
|
||||||
|
RoleBaseInfo = owner.GetRoleBaseInfo()
|
||||||
|
};
|
||||||
|
owner.Send(ScMsgId.ScQuestStateUpdate, update);
|
||||||
|
owner.Send(ScMsgId.ScQuestObjectivesUpdate, upd);
|
||||||
|
}
|
||||||
|
|
||||||
|
quests.Add(quest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ProcessQuest(string id)
|
||||||
|
{
|
||||||
|
GameQuest quest = GetQuestById(id);
|
||||||
|
if (quest != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
quest.state = QuestState.Processing;
|
||||||
|
var data = GetQuestData(id);
|
||||||
|
ScQuestStateUpdate update = new()
|
||||||
|
{
|
||||||
|
QuestId = quest.questId,
|
||||||
|
QuestState = (int)quest.state,
|
||||||
|
RoleBaseInfo = owner.GetRoleBaseInfo()
|
||||||
|
};
|
||||||
|
ScQuestObjectivesUpdate upd = new()
|
||||||
|
{
|
||||||
|
QuestId = data.questId,
|
||||||
|
|
||||||
|
};
|
||||||
|
data.objectiveList.ForEach(o =>
|
||||||
|
{
|
||||||
|
upd.QuestObjectives.Add(new QuestObjective()
|
||||||
|
{
|
||||||
|
ConditionId = o.condition.uniqueId,
|
||||||
|
Values =
|
||||||
|
{
|
||||||
|
{o.condition.uniqueId,0 }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
owner.Send(ScMsgId.ScQuestObjectivesUpdate, upd);
|
||||||
|
owner.Send(ScMsgId.ScQuestStateUpdate, update);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void CompleteQuest(string id)
|
||||||
|
{
|
||||||
|
GameQuest quest = GetQuestById(id);
|
||||||
|
if (quest != null)
|
||||||
|
{
|
||||||
|
quest.state = QuestState.Completed;
|
||||||
|
var data = GetQuestData(id);
|
||||||
|
ScQuestStateUpdate update = new()
|
||||||
|
{
|
||||||
|
QuestId = quest.questId,
|
||||||
|
QuestState=(int)quest.state,
|
||||||
|
};
|
||||||
|
ScQuestObjectivesUpdate upd = new()
|
||||||
|
{
|
||||||
|
QuestId = data.questId,
|
||||||
|
|
||||||
|
};
|
||||||
|
data.objectiveList.ForEach(o =>
|
||||||
|
{
|
||||||
|
upd.QuestObjectives.Add(new QuestObjective()
|
||||||
|
{
|
||||||
|
ConditionId = o.condition.uniqueId,
|
||||||
|
IsComplete=true,
|
||||||
|
Values =
|
||||||
|
{
|
||||||
|
{o.condition.uniqueId,1 }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
owner.Send(ScMsgId.ScQuestObjectivesUpdate, upd);
|
||||||
|
owner.Send(ScMsgId.ScQuestStateUpdate, update);
|
||||||
|
quests.Remove(quest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class GameQuest
|
||||||
|
{
|
||||||
|
public string questId;
|
||||||
|
public QuestState state;
|
||||||
|
public GameQuest()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public GameQuest(string id, QuestState state = QuestState.Available)
|
||||||
|
{
|
||||||
|
questId = id;
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class GameMission
|
||||||
|
{
|
||||||
|
public string missionId;
|
||||||
|
public MissionState state;
|
||||||
|
|
||||||
|
public GameMission()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public GameMission(string id, MissionState state = MissionState.Available)
|
||||||
|
{
|
||||||
|
missionId = id;
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,14 +3,7 @@ using Campofinale.Game.Inventory;
|
|||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using SharpCompress.Common;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Numerics;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
using static Campofinale.Resource.ResourceManager.LevelScene.LevelData;
|
||||||
|
|
||||||
@ -308,7 +301,7 @@ namespace Campofinale.Game
|
|||||||
|
|
||||||
lv_scene.levelData.interactives.ForEach(en =>
|
lv_scene.levelData.interactives.ForEach(en =>
|
||||||
{
|
{
|
||||||
if (en.defaultHide || GetOwner().noSpawnAnymore.Contains(en.levelLogicId))
|
if (GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId != 87)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -325,7 +318,7 @@ namespace Campofinale.Game
|
|||||||
});
|
});
|
||||||
lv_scene.levelData.factoryRegions.ForEach(en =>
|
lv_scene.levelData.factoryRegions.ForEach(en =>
|
||||||
{
|
{
|
||||||
if (en.defaultHide || GetOwner().noSpawnAnymore.Contains(en.levelLogicId))
|
if (GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId!=87)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -336,11 +329,13 @@ namespace Campofinale.Game
|
|||||||
levelLogicId = en.levelLogicId,
|
levelLogicId = en.levelLogicId,
|
||||||
type = en.entityType,
|
type = en.entityType,
|
||||||
};
|
};
|
||||||
|
|
||||||
entities.Add(entity);
|
entities.Add(entity);
|
||||||
});
|
});
|
||||||
lv_scene.levelData.enemies.ForEach(en =>
|
lv_scene.levelData.enemies.ForEach(en =>
|
||||||
{
|
{
|
||||||
if(en.defaultHide || GetOwner().noSpawnAnymore.Contains(en.levelLogicId)) return;
|
if(GetOwner().noSpawnAnymore.Contains(en.levelLogicId) && sceneNumId != 87) return;
|
||||||
|
if (en.defaultHide) return;
|
||||||
EntityMonster entity = new(en.entityDataIdKey,en.level,ownerId,en.position,en.rotation, sceneNumId, en.levelLogicId)
|
EntityMonster entity = new(en.entityDataIdKey,en.level,ownerId,en.position,en.rotation, sceneNumId, en.levelLogicId)
|
||||||
{
|
{
|
||||||
type=en.entityType,
|
type=en.entityType,
|
||||||
@ -362,36 +357,68 @@ namespace Campofinale.Game
|
|||||||
};
|
};
|
||||||
entities.Add(entity);
|
entities.Add(entity);
|
||||||
});
|
});
|
||||||
/*GetEntityExcludingChar().ForEach(e =>
|
GetEntityExcludingChar().ForEach(e =>
|
||||||
{
|
{
|
||||||
GetOwner().Send(new PacketScObjectEnterView(GetOwner(),new List<Entity>() { e}));
|
// GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List<Entity>() { e}));
|
||||||
});*/
|
|
||||||
|
});
|
||||||
UpdateShowEntities();
|
UpdateShowEntities();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
public void SpawnEntity(Entity en,bool spawnedCheck=true)
|
||||||
|
{
|
||||||
|
en.spawned = true;
|
||||||
|
List<Entity> toSpawn = new List<Entity>();
|
||||||
|
if(en.belongLevelScriptId != 0)
|
||||||
|
if (spawnedCheck)
|
||||||
|
{
|
||||||
|
foreach (Entity e in GetEntityExcludingChar().FindAll(e => e.belongLevelScriptId == en.belongLevelScriptId && e.spawned == false))
|
||||||
|
{
|
||||||
|
e.spawned = true;
|
||||||
|
toSpawn.Add(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (Entity e in GetEntityExcludingChar().FindAll(e => e.belongLevelScriptId == en.belongLevelScriptId && e != en))
|
||||||
|
{
|
||||||
|
e.spawned = true;
|
||||||
|
toSpawn.Add(e);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
toSpawn.Add(en);
|
||||||
|
toSpawn.ForEach(e =>
|
||||||
|
{
|
||||||
|
GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List<Entity>() { e}));
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
public void UpdateShowEntities()
|
public void UpdateShowEntities()
|
||||||
{
|
{
|
||||||
foreach(Entity en in GetEntityExcludingChar())
|
foreach(Entity en in GetEntityExcludingChar())
|
||||||
{
|
{
|
||||||
if (en.Position.Distance(GetOwner().position) < 200)
|
if (en.Position.Distance(GetOwner().position) < 100)
|
||||||
{
|
{
|
||||||
if (!en.spawned)
|
if (!en.spawned)
|
||||||
{
|
{
|
||||||
en.spawned = true;
|
SpawnEntity(en);
|
||||||
GetOwner().Send(new PacketScObjectEnterView(GetOwner(), new List<Entity>() { en }));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (en.spawned)
|
|
||||||
|
/*if (en.spawned)
|
||||||
{
|
{
|
||||||
|
|
||||||
en.spawned = false;
|
en.spawned = false;
|
||||||
GetOwner().Send(new PacketScObjectLeaveView(GetOwner(), new List<ulong>() { en.guid }));
|
GetOwner().Send(new PacketScObjectLeaveView(GetOwner(), new List<ulong>() { en.guid }));
|
||||||
en.Position=en.BornPos;
|
en.Position=en.BornPos;
|
||||||
en.Rotation = en.Rotation;
|
en.Rotation = en.Rotation;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -400,5 +427,22 @@ namespace Campofinale.Game
|
|||||||
{
|
{
|
||||||
return Server.clients.Find(c => c.roleId == ownerId);
|
return Server.clients.Find(c => c.roleId == ownerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SpawnEnemy(ulong v)
|
||||||
|
{
|
||||||
|
LevelScene lv_scene = ResourceManager.GetLevelData(sceneNumId);
|
||||||
|
LevelEnemyData en = lv_scene.levelData.enemies.Find(e=>e.levelLogicId == v);
|
||||||
|
if(en!=null)
|
||||||
|
{
|
||||||
|
EntityMonster entity = new(en.entityDataIdKey, en.level, ownerId, en.position, en.rotation, sceneNumId, en.levelLogicId)
|
||||||
|
{
|
||||||
|
type = en.entityType,
|
||||||
|
belongLevelScriptId = en.belongLevelScriptId,
|
||||||
|
levelLogicId = en.levelLogicId
|
||||||
|
};
|
||||||
|
entities.Add(entity);
|
||||||
|
SpawnEntity(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,5 @@
|
|||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
using MongoDB.Bson.Serialization.IdGenerators;
|
using MongoDB.Bson.Serialization.IdGenerators;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
|
|
||||||
@ -46,6 +40,7 @@ namespace Campofinale.Game.Spaceship
|
|||||||
IsWorking = isWorking,
|
IsWorking = isWorking,
|
||||||
PhysicalStrength = physicalStrength,
|
PhysicalStrength = physicalStrength,
|
||||||
StationedRoomId = stationedRoomId,
|
StationedRoomId = stationedRoomId,
|
||||||
|
|
||||||
Skills =
|
Skills =
|
||||||
{
|
{
|
||||||
new ScdSpaceshipCharSkill()
|
new ScdSpaceshipCharSkill()
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using Campofinale.Game.Inventory;
|
|
||||||
using MongoDB.Bson.Serialization.Attributes;
|
|
||||||
using MongoDB.Bson;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MongoDB.Bson.Serialization.IdGenerators;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
|
using Campofinale.Resource.Table;
|
||||||
|
|
||||||
namespace Campofinale.Game.Spaceship
|
namespace Campofinale.Game.Spaceship
|
||||||
{
|
{
|
||||||
@ -84,6 +75,39 @@ namespace Campofinale.Game.Spaceship
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void GiftToChar(CsSpaceshipPresentGiftToChar req)
|
||||||
|
{
|
||||||
|
SpaceshipChar chara = GetChar(req.CharId);
|
||||||
|
if (chara != null)
|
||||||
|
{
|
||||||
|
foreach (var item in req.Gifts)
|
||||||
|
{
|
||||||
|
GiftItemTable giftItem = ResourceManager.giftItemTable[item.Id];
|
||||||
|
chara.favorability += giftItem.favorablePoint * item.Count;
|
||||||
|
//TODO item consume
|
||||||
|
}
|
||||||
|
ScSpaceshipPresentGiftToChar confirm = new()
|
||||||
|
{
|
||||||
|
CurFav = chara.favorability,
|
||||||
|
CharId = chara.id,
|
||||||
|
RecvGiftCnt = req.Gifts.Count,
|
||||||
|
};
|
||||||
|
//TODO packet class
|
||||||
|
/*ScSpaceshipCharFavorabilityChange change = new()
|
||||||
|
{
|
||||||
|
ChangeInfos =
|
||||||
|
{
|
||||||
|
new SpaceshipCharFavorabilityChangeInfo()
|
||||||
|
{
|
||||||
|
CharId = chara.id,
|
||||||
|
CurFav=chara.favorability,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};*/
|
||||||
|
owner.Send(Protocol.ScMsgId.ScSpaceshipPresentGiftToChar, confirm);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
using MongoDB.Bson.Serialization.Attributes;
|
using MongoDB.Bson.Serialization.Attributes;
|
||||||
using MongoDB.Bson;
|
using MongoDB.Bson;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using MongoDB.Bson.Serialization.IdGenerators;
|
using MongoDB.Bson.Serialization.IdGenerators;
|
||||||
|
|||||||
@ -1,10 +1,4 @@
|
|||||||
using System;
|
namespace Campofinale.Game
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Campofinale.Game
|
|
||||||
{
|
{
|
||||||
public class Team
|
public class Team
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,18 +1,5 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Game;
|
||||||
using Campofinale.Game;
|
|
||||||
using Campofinale.Game.Gacha;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
|
||||||
using HttpServerLite;
|
using HttpServerLite;
|
||||||
using MongoDB.Bson.IO;
|
|
||||||
using SQLite;
|
|
||||||
using SQLiteNetExtensions.Extensions;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Channels;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Gacha.GachaManager;
|
|
||||||
|
|
||||||
namespace Campofinale.Http
|
namespace Campofinale.Http
|
||||||
{
|
{
|
||||||
@ -65,7 +52,17 @@ namespace Campofinale.Http
|
|||||||
await data(ctx);
|
await data(ctx);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/serverStatus")]
|
||||||
|
public static async Task serverStatus(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{\"maxPlayers\":" + Server.config.serverOptions.maxPlayers + ", \"players\":" + Server.clients.Count + ", \"status\":\"Online\", \"gameVersion\": \"" + GameConstants.GAME_VERSION + "\", \"serverVersion\": \"" + Server.ServerVersion + "\"}";
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.POST, "/u8/pay/getAllProductList")]
|
[StaticRoute(HttpServerLite.HttpMethod.POST, "/u8/pay/getAllProductList")]
|
||||||
public static async Task getAllProductList(HttpContext ctx)
|
public static async Task getAllProductList(HttpContext ctx)
|
||||||
{
|
{
|
||||||
@ -77,6 +74,7 @@ namespace Campofinale.Http
|
|||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
await ctx.Response.SendAsync(resp);
|
||||||
}
|
}
|
||||||
|
//WINDOWS
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest")]
|
||||||
public static async Task get_latest(HttpContext ctx)
|
public static async Task get_latest(HttpContext ctx)
|
||||||
{
|
{
|
||||||
@ -89,6 +87,18 @@ namespace Campofinale.Http
|
|||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
await ctx.Response.SendAsync(resp);
|
||||||
}
|
}
|
||||||
|
//ANDROID
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/game/get_latest_game_info")]
|
||||||
|
public static async Task get_latest_game_info(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{\"version\":\""+ GameConstants.GAME_VERSION_ANDROID + "\",\"action\":0,\"update_type\":0,\"update_info\":{\"package\":null,\"patch\":null,\"custom_info\":\"\",\"source_package\":null},\"client_version\":\"\"}";
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/default/network_config")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/default/network_config")]
|
||||||
public static async Task network_config(HttpContext ctx)
|
public static async Task network_config(HttpContext ctx)
|
||||||
{
|
{
|
||||||
@ -100,21 +110,11 @@ namespace Campofinale.Http
|
|||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
await ctx.Response.SendAsync(resp);
|
||||||
}
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/network_config")]
|
|
||||||
public static async Task network_config_cn(HttpContext ctx)
|
|
||||||
{
|
|
||||||
string resp = "{\"asset\":\"https://beyond.hg-cdn.com/asset/\",\"hgage\":\"\",\"sdkenv\":\"2\",\"u8root\":\"https://u8.gryphline.com/u8\",\"appcode\":4,\"channel\":\"prod\",\"netlogid\":\"GFz8RRMDN45w\",\"gameclose\":false,\"netlogurl\":\"http://native-log-collect.gryphline.com:32000/\",\"accounturl\":\"https://binding-api-account-prod.gryphline.com\",\"launcherurl\":\"https://launcher.gryphline.com\"}";
|
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
|
||||||
ctx.Response.ContentLength = resp.Length;
|
|
||||||
ctx.Response.ContentType = "application/json";
|
|
||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
|
||||||
}
|
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/Windows/game_config")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/Windows/game_config")]
|
||||||
public static async Task game_config(HttpContext ctx)
|
public static async Task game_config(HttpContext ctx)
|
||||||
{
|
{
|
||||||
string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": false, \"enableEntitySpawnLog\": false}";
|
string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": false, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false}";
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
ctx.Response.StatusCode = 200;
|
||||||
ctx.Response.ContentLength = resp.Length;
|
ctx.Response.ContentLength = resp.Length;
|
||||||
@ -122,17 +122,7 @@ namespace Campofinale.Http
|
|||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
await ctx.Response.SendAsync(resp);
|
||||||
}
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/game_config")]
|
|
||||||
public static async Task game_config_cn(HttpContext ctx)
|
|
||||||
{
|
|
||||||
string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": false, \"enableEntitySpawnLog\": false}";
|
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
|
||||||
ctx.Response.ContentLength = resp.Length;
|
|
||||||
ctx.Response.ContentType = "application/json";
|
|
||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
|
||||||
}
|
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/gameBulletin/version")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/gameBulletin/version")]
|
||||||
public static async Task Version(HttpContext ctx)
|
public static async Task Version(HttpContext ctx)
|
||||||
{
|
{
|
||||||
@ -151,8 +141,27 @@ namespace Campofinale.Http
|
|||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/app/v1/config")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/app/v1/config")]
|
||||||
public static async Task config_check(HttpContext ctx)
|
public static async Task config_check(HttpContext ctx)
|
||||||
{
|
{
|
||||||
|
string appCode = ctx.Request.Query.Elements["appCode"];
|
||||||
|
|
||||||
|
|
||||||
string resp = "{\"data\":{\"agreementUrl\":{\"register\":\"https://user.gryphline.com/{language}/protocol/plain/terms_of_service\",\"privacy\":\"https://user.gryphline.com/{language}/protocol/plain/privacy_policy\",\"unbind\":\"https://user.gryphline.com/{language}/protocol/plain/endfield/privacy_policy\",\"account\":\"https://user.gryphline.com/{language}/protocol/plain/terms_of_service\",\"game\":\"https://user.gryphline.com/{language}/protocol/plain/endfield/privacy_policy\"},\"app\":{\"googleAndroidClientId\":\"\",\"googleIosClientId\":\"\",\"enableAutoLogin\":true,\"enablePayment\":true,\"enableGuestRegister\":false,\"needShowName\":true,\"displayName\":{\"en-us\":\"Arknights: Endfield\",\"ja-jp\":\"アークナイツ:エンドフィールド\",\"ko-kr\":\"명일방주:엔드필드\",\"zh-cn\":\"明日方舟:终末地\",\"zh-tw\":\"明日方舟:終末地\"},\"unbindAgreement\":[],\"unbindLimitedDays\":30,\"unbindCoolDownDays\":14,\"customerServiceUrl\":\"https://gryphline.helpshift.com/hc/{language}/4-arknights-endfield\",\"enableUnbindGrant\":false},\"customerServiceUrl\":\"https://gryphline.helpshift.com/hc/{language}/4-arknights-endfield\",\"thirdPartyRedirectUrl\":\"https://web-api.gryphline.com/callback/thirdPartyAuth.html\",\"scanUrl\":{\"login\":\"yj://scan_login\"},\"loginChannels\":[],\"userCenterUrl\":\"https://user.gryphline.com/pcSdk/userInfo?language={language}\"},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}";
|
string resp = "{\"data\":{\"agreementUrl\":{\"register\":\"https://user.gryphline.com/{language}/protocol/plain/terms_of_service\",\"privacy\":\"https://user.gryphline.com/{language}/protocol/plain/privacy_policy\",\"unbind\":\"https://user.gryphline.com/{language}/protocol/plain/endfield/privacy_policy\",\"account\":\"https://user.gryphline.com/{language}/protocol/plain/terms_of_service\",\"game\":\"https://user.gryphline.com/{language}/protocol/plain/endfield/privacy_policy\"},\"app\":{\"googleAndroidClientId\":\"\",\"googleIosClientId\":\"\",\"enableAutoLogin\":true,\"enablePayment\":true,\"enableGuestRegister\":false,\"needShowName\":true,\"displayName\":{\"en-us\":\"Arknights: Endfield\",\"ja-jp\":\"アークナイツ:エンドフィールド\",\"ko-kr\":\"명일방주:엔드필드\",\"zh-cn\":\"明日方舟:终末地\",\"zh-tw\":\"明日方舟:終末地\"},\"unbindAgreement\":[],\"unbindLimitedDays\":30,\"unbindCoolDownDays\":14,\"customerServiceUrl\":\"https://gryphline.helpshift.com/hc/{language}/4-arknights-endfield\",\"enableUnbindGrant\":false},\"customerServiceUrl\":\"https://gryphline.helpshift.com/hc/{language}/4-arknights-endfield\",\"thirdPartyRedirectUrl\":\"https://web-api.gryphline.com/callback/thirdPartyAuth.html\",\"scanUrl\":{\"login\":\"yj://scan_login\"},\"loginChannels\":[],\"userCenterUrl\":\"https://user.gryphline.com/pcSdk/userInfo?language={language}\"},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}";
|
||||||
|
|
||||||
|
if(appCode == "a65356244d22261b")
|
||||||
|
{
|
||||||
|
resp = "{ \"data\": { \"antiAddiction\": { \"minorPeriodEnd\": 21, \"minorPeriodStart\": 20 }, \"payment\": [ { \"key\": \"alipay\", \"recommend\": true }, { \"key\": \"wechat\", \"recommend\": false }, { \"key\": \"pcredit\", \"recommend\": false } ], \"customerServiceUrl\": \"https://chat.hypergryph.com/chat/h5/v2/index.html?sysnum=889ee281e3564ddf883942fe85764d44&channelid=2\", \"cancelDeactivateUrl\": \"https://user-stable.hypergryph.com/cancellation\", \"agreementUrl\": { \"game\": \"https://hg-protocol-static-web-stable.hypergryph.net/protocol/plain/ak/index\", \"unbind\": \"https://hg-protocol-static-web-stable.hypergryph.net/protocol/plain/ak/cancellation\", \"gameService\": \"https://hg-protocol-static-web-stable.hypergryph.net/protocol/plain/ak/service\", \"account\": \"https://user.hypergryph.com/protocol/plain/index\", \"privacy\": \"https://user.hypergryph.com/protocol/plain/privacy\", \"register\": \"https://user.hypergryph.com/protocol/plain/registration\", \"updateOverview\": \"https://user.hypergryph.com/protocol/plain/overview_of_changes\", \"childrenPrivacy\": \"https://user.hypergryph.com/protocol/plain/children_privacy\" }, \"app\": { \"enablePayment\": true, \"enableAutoLogin\": true, \"enableAuthenticate\": true, \"enableAntiAddiction\": true, \"enableUnbindGrant\": true, \"wechatAppId\": \"wxeea7cc50e03edb28\", \"alipayAppId\": \"2021004129658342\", \"oneLoginAppId\": \"496b284079be97612a46266a9fdbfbd7\", \"enablePaidApp\": false, \"appName\": \"明日方舟终末地\", \"appAmount\": 600, \"needShowName\": true, \"customerServiceUrl\": \"https://web-biz-platform-cs-center-stable.hypergryph.net/hg/?hg_token={hg_token}&source_from=sdk\", \"needAntiAddictionAlert\": true, \"enableScanLogin\": false, \"deviceCheckMode\": 0, \"enableGiftCode\": false }, \"scanUrl\": { \"login\": \"hypergryph://scan_login\" }, \"userCenterUrl\": \"https://user-center-account-stable.hypergryph.net/pcSdk/userInfo\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}";
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
//ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/general/v1/server_time")]
|
||||||
|
public static async Task server_time(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{\"data\":{\"serverTime\":1748021408,\"isHoliday\":true},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
ctx.Response.StatusCode = 200;
|
||||||
@ -169,35 +178,8 @@ namespace Campofinale.Http
|
|||||||
public string password;
|
public string password;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/res_version")]
|
|
||||||
public static async Task cn_res_version(HttpContext ctx)
|
|
||||||
{
|
|
||||||
|
|
||||||
string resp = "{\"version\": \"2089329-32\", \"kickFlag\": true}";
|
|
||||||
|
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
|
||||||
//ctx.Response.ContentLength = resp.Length;
|
|
||||||
ctx.Response.ContentType = "application/json";
|
|
||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
|
||||||
}
|
|
||||||
|
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/server_config_China")]
|
|
||||||
public static async Task server_config_China(HttpContext ctx)
|
|
||||||
{
|
|
||||||
string requestBody = ctx.Request.DataAsString;
|
|
||||||
Console.WriteLine(requestBody);
|
|
||||||
string resp = "{\"addr\": \"" + Server.config.gameServer.accessAddress + "\", \"port\": " + Server.config.gameServer.accessPort + "}";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
|
||||||
|
|
||||||
ctx.Response.ContentType = "application/json";
|
|
||||||
|
|
||||||
await ctx.Response.SendAsync(resp);
|
|
||||||
}
|
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/default/server_config_EUAndUS")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/1003/prod-cbt/default/default/server_config_EUAndUS")]
|
||||||
public static async Task server_config_EUAndUS(HttpContext ctx)
|
public static async Task server_config_EUAndUS(HttpContext ctx)
|
||||||
{
|
{
|
||||||
|
|||||||
90
Campofinale/Http/DispatchCN.cs
Normal file
90
Campofinale/Http/DispatchCN.cs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
using HttpServerLite;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Campofinale.Http
|
||||||
|
{
|
||||||
|
internal class DispatchCN
|
||||||
|
{
|
||||||
|
//SERVER
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/server_config_China")]
|
||||||
|
public static async Task server_config_China(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string requestBody = ctx.Request.DataAsString;
|
||||||
|
Console.WriteLine(requestBody);
|
||||||
|
string resp = "{\"addr\": \"" + Server.config.gameServer.accessAddress + "\", \"port\": " + Server.config.gameServer.accessPort + "}";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
//DEFAULT
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/default/network_config")]
|
||||||
|
public static async Task network_config_cn(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{ \"asset\": \"https://beyond.hycdn.cn/asset/\", \"hgage\": \"https://web.hycdn.cn/endfield/protocol/cadpa-age.txt\", \"sdkenv\": \"2\", \"u8root\": \"https://as.hypergryph.com/u8\", \"appcode\": 4, \"channel\": \"prod\", \"netlogid\": \"56RqF5G2gU9j\", \"gameclose\": false, \"netlogurl\": \"http://native-log-collect.hypergryph.com:32000\", \"accounturl\": \"https://binding-api-account-prod.hypergryph.com\", \"launcherurl\": \"https://launcher.hypergryph.com\"}";
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
//WINDOWS
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/res_version")]
|
||||||
|
public static async Task cn_res_version(HttpContext ctx)
|
||||||
|
{
|
||||||
|
|
||||||
|
string resp = "{\"version\": \"2089329-32\", \"kickFlag\": false}";
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
//ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Windows/game_config")]
|
||||||
|
public static async Task game_config_cn_windows(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false}";
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
//ANDROID
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/res_version")]
|
||||||
|
public static async Task cn_android_res_version(HttpContext ctx)
|
||||||
|
{
|
||||||
|
|
||||||
|
string resp = "{\"version\": \"2377591-182\", \"kickFlag\": false}";
|
||||||
|
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
//ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/api/remote_config/get_remote_config/3/prod-cbt/default/Android/game_config")]
|
||||||
|
public static async Task game_config_cn_android(HttpContext ctx)
|
||||||
|
{
|
||||||
|
string resp = "{\"mockLogin\": false, \"selectSrv\": false, \"enableHotUpdate\": true, \"enableNpcOptimize\": false, \"enableEntitySpawnLog\": false, \"enableCBT2AccessForbidden\": false, \"enableMobileFullScreenWaterMark\": false}";
|
||||||
|
|
||||||
|
ctx.Response.StatusCode = 200;
|
||||||
|
ctx.Response.ContentLength = resp.Length;
|
||||||
|
ctx.Response.ContentType = "application/json";
|
||||||
|
|
||||||
|
await ctx.Response.SendAsync(resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,6 @@
|
|||||||
using Campofinale.Commands;
|
using Campofinale.Commands;
|
||||||
using Campofinale.Commands.Handlers;
|
|
||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using HttpServerLite;
|
using HttpServerLite;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +26,8 @@ namespace Campofinale.Http
|
|||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/pcSdk/console")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/pcSdk/console")]
|
||||||
public static async Task ConsoleResponce(HttpContext ctx)
|
public static async Task ConsoleResponce(HttpContext ctx)
|
||||||
{
|
{
|
||||||
string cmd = ctx.Request.Query.Elements["command"].Replace("+"," ");
|
string encodedCmd = Uri.UnescapeDataString(ctx.Request.Query.Elements["command"]);
|
||||||
|
string cmd = Encoding.UTF8.GetString(Convert.FromBase64String(encodedCmd));
|
||||||
string token = ctx.Request.Query.Elements["token"];
|
string token = ctx.Request.Query.Elements["token"];
|
||||||
string message = "";
|
string message = "";
|
||||||
string[] split = cmd.Split(" ");
|
string[] split = cmd.Split(" ");
|
||||||
|
|||||||
@ -1,11 +1,5 @@
|
|||||||
using Campofinale.Database;
|
using Campofinale.Database;
|
||||||
using Campofinale.Resource;
|
|
||||||
using HttpServerLite;
|
using HttpServerLite;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using static Campofinale.Game.Gacha.GachaManager;
|
using static Campofinale.Game.Gacha.GachaManager;
|
||||||
using static Campofinale.Http.Dispatch;
|
using static Campofinale.Http.Dispatch;
|
||||||
|
|
||||||
@ -79,7 +73,11 @@ namespace Campofinale.Http
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/batch_event")]
|
||||||
|
public static async Task batch_event(HttpContext ctx)
|
||||||
|
{
|
||||||
|
await ctx.Response.SendAsync("OK");
|
||||||
|
}
|
||||||
[StaticRoute(HttpServerLite.HttpMethod.GET, "/user/info/v1/basic")]
|
[StaticRoute(HttpServerLite.HttpMethod.GET, "/user/info/v1/basic")]
|
||||||
public static async Task account_info_get(HttpContext ctx)
|
public static async Task account_info_get(HttpContext ctx)
|
||||||
{
|
{
|
||||||
@ -88,7 +86,10 @@ namespace Campofinale.Http
|
|||||||
string resp = "{\"data\":{\"hgId\":\"1799321925\",\"email\":\"dispatch@endfield.ps\",\"realEmail\":\"dispatch@endfield.ps\",\"isLatestUserAgreement\":true,\"nickName\":\"Campofinale\"},\"msg\":\"OK\",\"status\":0,\"type\":1}";
|
string resp = "{\"data\":{\"hgId\":\"1799321925\",\"email\":\"dispatch@endfield.ps\",\"realEmail\":\"dispatch@endfield.ps\",\"isLatestUserAgreement\":true,\"nickName\":\"Campofinale\"},\"msg\":\"OK\",\"status\":0,\"type\":1}";
|
||||||
if (account != null)
|
if (account != null)
|
||||||
{
|
{
|
||||||
resp = "{\"data\":{\"idCardNum\": 110102200610048887,\"hgId\":\"" + account.id + "\",\"email\":\"" + account.username +Server.config.dispatchServer.emailFormat +"\",\"realEmail\":\"" + account.username + Server.config.dispatchServer.emailFormat + "\",\"isLatestUserAgreement\":true,\"nickName\":\"" + account.username + "\",\"name\":\"AAAA\"},\"msg\":\"OK\",\"status\":0,\"type\":1}";
|
/*
|
||||||
|
* {"data":{"hgId":"1326618825955","phone":"153****5243","email":null,"identityNum":"5002**********1619","identityName":"金*","isMinor":false,"isLatestUserAgreement":true},"msg":"OK","status":0,"type":"A"}
|
||||||
|
*/
|
||||||
|
resp = "{\"data\":{\"phone\":\"153****5243\", \"identityNum\": \"5002**********1619\",\"identityName\":\"金*\",\"isMinor\":false,\"hgId\":\"" + account.id + "\",\"email\":\"" + account.username +Server.config.dispatchServer.emailFormat +"\",\"realEmail\":\"" + account.username + Server.config.dispatchServer.emailFormat + "\",\"isLatestUserAgreement\":true,\"nickName\":\"" + account.username + "\"},\"msg\":\"OK\",\"status\":0,\"type\":\"A\"}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -138,7 +139,8 @@ namespace Campofinale.Http
|
|||||||
string resp = "{\"msg\": \"Error\", \"status\": 2, \"type\": \"A\"}";
|
string resp = "{\"msg\": \"Error\", \"status\": 2, \"type\": \"A\"}";
|
||||||
if (account != null)
|
if (account != null)
|
||||||
{
|
{
|
||||||
resp = "{\"data\": { \"uid\": \"" + account.id + "\", \"code\": \"" + account.grantToken + "\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}";
|
|
||||||
|
resp = "{\"data\": { \"token\": \"" + account.token + "\", \"uid\": \"" + account.id + "\", \"code\": \"" + account.grantToken + "\" }, \"msg\": \"OK\", \"status\": 0, \"type\": \"A\"}";
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Response.StatusCode = 200;
|
ctx.Response.StatusCode = 200;
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
using Campofinale;
|
using Campofinale;
|
||||||
|
|
||||||
using Pastel;
|
using Pastel;
|
||||||
using System;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
|
||||||
public static class Logger
|
public static class Logger
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -20,6 +18,10 @@ public static class Logger
|
|||||||
var method = frame?.GetMethod();
|
var method = frame?.GetMethod();
|
||||||
return method?.DeclaringType?.Name ?? "Server";
|
return method?.DeclaringType?.Name ?? "Server";
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Print a text in the console
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text"></param>
|
||||||
public static void Print(string text)
|
public static void Print(string text)
|
||||||
{
|
{
|
||||||
string className = GetCallingClassName();
|
string className = GetCallingClassName();
|
||||||
@ -27,6 +29,10 @@ public static class Logger
|
|||||||
string prefix = "<" + "INFO".Pastel("03fcce") + $":{className.Pastel("999")}>";
|
string prefix = "<" + "INFO".Pastel("03fcce") + $":{className.Pastel("999")}>";
|
||||||
Console.WriteLine($"{prefix} " + text);
|
Console.WriteLine($"{prefix} " + text);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Print a text in the console as Error
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text"></param>
|
||||||
public static void PrintError(string text)
|
public static void PrintError(string text)
|
||||||
{
|
{
|
||||||
string className = GetCallingClassName();
|
string className = GetCallingClassName();
|
||||||
@ -34,8 +40,15 @@ public static class Logger
|
|||||||
string prefix = "<" + "ERROR".Pastel("eb4034") + $":{className.Pastel("999")}>";
|
string prefix = "<" + "ERROR".Pastel("eb4034") + $":{className.Pastel("999")}>";
|
||||||
Console.WriteLine($"{prefix} " + text.Pastel("917e7e"));
|
Console.WriteLine($"{prefix} " + text.Pastel("917e7e"));
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Print a text in the console as a Warn
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text"></param>
|
||||||
public static void PrintWarn(string text)
|
public static void PrintWarn(string text)
|
||||||
{
|
{
|
||||||
|
if (!Server.config.logOptions.packetWarnings)
|
||||||
|
return;
|
||||||
|
|
||||||
string className = GetCallingClassName();
|
string className = GetCallingClassName();
|
||||||
Logger.Log(text);
|
Logger.Log(text);
|
||||||
string prefix = "<" + "WARN".Pastel("ff9100") + $":{className.Pastel("999")}>";
|
string prefix = "<" + "WARN".Pastel("ff9100") + $":{className.Pastel("999")}>";
|
||||||
@ -43,7 +56,9 @@ public static class Logger
|
|||||||
}
|
}
|
||||||
public static string GetColor(string c)
|
public static string GetColor(string c)
|
||||||
{
|
{
|
||||||
if (ClassColors.ContainsKey(c)) return ClassColors[c];
|
if (ClassColors.ContainsKey(c))
|
||||||
|
return ClassColors[c];
|
||||||
|
|
||||||
return "999";
|
return "999";
|
||||||
}
|
}
|
||||||
private static StreamWriter logWriter;
|
private static StreamWriter logWriter;
|
||||||
@ -52,22 +67,25 @@ public static class Logger
|
|||||||
public static void Initialize(bool hideLogs = false)
|
public static void Initialize(bool hideLogs = false)
|
||||||
{
|
{
|
||||||
Logger.hideLogs = hideLogs;
|
Logger.hideLogs = hideLogs;
|
||||||
|
|
||||||
logWriter = new StreamWriter("latest.log", false);
|
logWriter = new StreamWriter("latest.log", false);
|
||||||
|
logWriter.AutoFlush = true;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
public static void Log(string message)
|
/// Log a message
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
private static void Log(string message)
|
||||||
{
|
{
|
||||||
if (!hideLogs)
|
if(hideLogs)
|
||||||
{
|
return;
|
||||||
try
|
|
||||||
{
|
|
||||||
logWriter.WriteLine($"{DateTime.Now}: {message}");
|
|
||||||
logWriter.Flush();
|
|
||||||
}
|
|
||||||
catch(Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
try
|
||||||
|
{
|
||||||
|
logWriter.WriteLine($"{DateTime.Now}: {message}");
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,9 @@
|
|||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
using Google.Protobuf;
|
||||||
using Pastel;
|
using Pastel;
|
||||||
using System;
|
|
||||||
using System.Buffers.Binary;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
||||||
|
|
||||||
namespace Campofinale.Network
|
namespace Campofinale.Network
|
||||||
{
|
{
|
||||||
@ -61,6 +50,11 @@ namespace Campofinale.Network
|
|||||||
byte networkValue = buf[index];
|
byte networkValue = buf[index];
|
||||||
return networkValue;
|
return networkValue;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Parse the body using a specific IMessage proto class
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TBody"></typeparam>
|
||||||
|
/// <returns></returns>
|
||||||
public TBody DecodeBody<TBody>() where TBody : IMessage<TBody>, new()
|
public TBody DecodeBody<TBody>() where TBody : IMessage<TBody>, new()
|
||||||
{
|
{
|
||||||
return new MessageParser<TBody>(() => new()).ParseFrom(finishedBody);
|
return new MessageParser<TBody>(() => new()).ParseFrom(finishedBody);
|
||||||
@ -76,35 +70,10 @@ namespace Campofinale.Network
|
|||||||
|
|
||||||
Buffer.BlockCopy(source, 0, destination, offset, source.Length);
|
Buffer.BlockCopy(source, 0, destination, offset, source.Length);
|
||||||
}
|
}
|
||||||
public static byte[] ToByteArray(IntPtr ptr, int length)
|
|
||||||
{
|
|
||||||
if (ptr == IntPtr.Zero)
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Pointer cannot be null", nameof(ptr));
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] byteArray = new byte[length];
|
|
||||||
Marshal.Copy(ptr, byteArray, 0, length);
|
|
||||||
return byteArray;
|
|
||||||
}
|
|
||||||
public static IntPtr ByteArrayToIntPtr(byte[] data)
|
|
||||||
{
|
|
||||||
if (data == null) throw new ArgumentNullException(nameof(data));
|
|
||||||
|
|
||||||
// Allocate unmanaged memory
|
|
||||||
IntPtr ptr = Marshal.AllocHGlobal(data.Length);
|
|
||||||
|
|
||||||
// Copy the byte array to the unmanaged memory
|
|
||||||
Marshal.Copy(data, 0, ptr, data.Length);
|
|
||||||
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
public static byte[] EncryptWithPublicKey(byte[] data, string publicKey)
|
public static byte[] EncryptWithPublicKey(byte[] data, string publicKey)
|
||||||
{
|
{
|
||||||
// Crea un oggetto RSA
|
|
||||||
using (RSA rsa = RSA.Create())
|
using (RSA rsa = RSA.Create())
|
||||||
{
|
{
|
||||||
|
|
||||||
publicKey = publicKey.Replace("-----BEGIN PUBLIC KEY-----", "");
|
publicKey = publicKey.Replace("-----BEGIN PUBLIC KEY-----", "");
|
||||||
publicKey = publicKey.Replace("\r", "");
|
publicKey = publicKey.Replace("\r", "");
|
||||||
publicKey = publicKey.Replace("\n", "");
|
publicKey = publicKey.Replace("\n", "");
|
||||||
@ -112,24 +81,44 @@ namespace Campofinale.Network
|
|||||||
publicKey = publicKey.Trim();
|
publicKey = publicKey.Trim();
|
||||||
Logger.Print(publicKey);
|
Logger.Print(publicKey);
|
||||||
byte[] publicKey_ = Convert.FromBase64String(publicKey);
|
byte[] publicKey_ = Convert.FromBase64String(publicKey);
|
||||||
// Importa la chiave pubblica
|
|
||||||
rsa.ImportSubjectPublicKeyInfo(publicKey_, out _);
|
rsa.ImportSubjectPublicKeyInfo(publicKey_, out _);
|
||||||
|
|
||||||
// Crittografa i dati
|
|
||||||
return rsa.Encrypt(data, RSAEncryptionPadding.OaepSHA256);
|
return rsa.Encrypt(data, RSAEncryptionPadding.OaepSHA256);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Set the data of the packet with the Message Id and the body
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="msgId"></param>
|
||||||
|
/// <param name="body">The proto message</param>
|
||||||
|
/// <returns>The current Packet</returns>
|
||||||
public Packet SetData(ScMsgId msgId, IMessage body)
|
public Packet SetData(ScMsgId msgId, IMessage body)
|
||||||
{
|
{
|
||||||
set_body = body;
|
set_body = body;
|
||||||
cmdId = (int)msgId;
|
cmdId = (int)msgId;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Encode the packet using the Packet class
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="packet">The packet</param>
|
||||||
|
/// <param name="seq">the sequence id</param>
|
||||||
|
/// <param name="totalPackCount">the pack count</param>
|
||||||
|
/// <param name="currentPackIndex"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static byte[] EncodePacket(Packet packet,ulong seq = 0, uint totalPackCount = 1, uint currentPackIndex = 0)
|
public static byte[] EncodePacket(Packet packet,ulong seq = 0, uint totalPackCount = 1, uint currentPackIndex = 0)
|
||||||
{
|
{
|
||||||
return EncodePacket(packet.cmdId,packet.set_body,seq, totalPackCount, currentPackIndex);
|
return EncodePacket(packet.cmdId,packet.set_body,seq, totalPackCount, currentPackIndex);
|
||||||
}
|
}
|
||||||
public static ulong seqNext = 1;
|
public static ulong seqNext = 1;
|
||||||
|
/// <summary>
|
||||||
|
/// Encode the packet using the msgId and the body
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="msgId"></param>
|
||||||
|
/// <param name="body"></param>
|
||||||
|
/// <param name="seqNext_"></param>
|
||||||
|
/// <param name="totalPackCount"></param>
|
||||||
|
/// <param name="currentPackIndex"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static byte[] EncodePacket(int msgId, IMessage body, ulong seqNext_ = 0, uint totalPackCount=1,uint currentPackIndex=0)
|
public static byte[] EncodePacket(int msgId, IMessage body, ulong seqNext_ = 0, uint totalPackCount=1,uint currentPackIndex=0)
|
||||||
{
|
{
|
||||||
if (seqNext_ == 0)
|
if (seqNext_ == 0)
|
||||||
@ -145,10 +134,19 @@ namespace Campofinale.Network
|
|||||||
PutByteArray(data, head.ToByteArray(), 3);
|
PutByteArray(data, head.ToByteArray(), 3);
|
||||||
PutByteArray(data, body.ToByteArray(), 3+head.ToByteArray().Length);
|
PutByteArray(data, body.ToByteArray(), 3+head.ToByteArray().Length);
|
||||||
if(Server.config.logOptions.packets && !Server.scMessageToHide.Contains((ScMsgId)msgId))
|
if(Server.config.logOptions.packets && !Server.scMessageToHide.Contains((ScMsgId)msgId))
|
||||||
Logger.Print($"Sending packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} id: {msgId} with {data.Length} bytes");
|
Logger.Print($"Sending Packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} Id: {msgId} with {data.Length} Bytes");
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Encode the packet with msgId and body as byte array
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="msgId"></param>
|
||||||
|
/// <param name="body"></param>
|
||||||
|
/// <param name="seqNext_"></param>
|
||||||
|
/// <param name="totalPackCount"></param>
|
||||||
|
/// <param name="currentPackIndex"></param>
|
||||||
|
/// <returns></returns>
|
||||||
public static byte[] EncodePacket(int msgId, byte[] body, ulong seqNext_ = 0, uint totalPackCount = 1, uint currentPackIndex = 0)
|
public static byte[] EncodePacket(int msgId, byte[] body, ulong seqNext_ = 0, uint totalPackCount = 1, uint currentPackIndex = 0)
|
||||||
{
|
{
|
||||||
if (seqNext_ == 0)
|
if (seqNext_ == 0)
|
||||||
@ -168,10 +166,16 @@ namespace Campofinale.Network
|
|||||||
PutByteArray(data, head.ToByteArray(), 3);
|
PutByteArray(data, head.ToByteArray(), 3);
|
||||||
PutByteArray(data, body, 3 + head.ToByteArray().Length);
|
PutByteArray(data, body, 3 + head.ToByteArray().Length);
|
||||||
if (Server.config.logOptions.packets && !Server.scMessageToHide.Contains((ScMsgId)msgId))
|
if (Server.config.logOptions.packets && !Server.scMessageToHide.Contains((ScMsgId)msgId))
|
||||||
Logger.Print($"Sending packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} id: {msgId} with {data.Length} bytes");
|
Logger.Print($"Sending Packet: {((ScMsgId)msgId).ToString().Pastel(Color.LightBlue)} Id: {msgId} with {data.Length} Bytes");
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Read the byteArray as a valid packet
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="client"></param>
|
||||||
|
/// <param name="byteArray"></param>
|
||||||
|
/// <returns>The decoded packet</returns>
|
||||||
public static Packet Read(Player client,byte[] byteArray)
|
public static Packet Read(Player client,byte[] byteArray)
|
||||||
{
|
{
|
||||||
byte headLength = GetByte(byteArray, 0);
|
byte headLength = GetByte(byteArray, 0);
|
||||||
@ -182,10 +186,10 @@ namespace Campofinale.Network
|
|||||||
Array.Copy(byteArray, 3, csHeadBytes, 0, headLength);
|
Array.Copy(byteArray, 3, csHeadBytes, 0, headLength);
|
||||||
Array.Copy(byteArray, 3+ headLength, BodyBytes, 0, bodyLength);
|
Array.Copy(byteArray, 3+ headLength, BodyBytes, 0, bodyLength);
|
||||||
CSHead csHead_ = CSHead.Parser.ParseFrom(csHeadBytes);
|
CSHead csHead_ = CSHead.Parser.ParseFrom(csHeadBytes);
|
||||||
if (Server.config.logOptions.packets)
|
/*if (Server.config.logOptions.packets && !Server.csMessageToHide.Contains((CsMsgId)csHead_.Msgid))
|
||||||
{
|
{
|
||||||
Logger.Print(csHead_.ToString());
|
Logger.Print(csHead_.ToString());
|
||||||
}
|
}*/
|
||||||
seqNext = csHead_.UpSeqid;
|
seqNext = csHead_.UpSeqid;
|
||||||
return new Packet() { csHead = csHead_, finishedBody = BodyBytes,cmdId=csHead_.Msgid };
|
return new Packet() { csHead = csHead_, finishedBody = BodyBytes,cmdId=csHead_.Msgid };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@
|
|||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Net.Sockets;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
|
|
||||||
|
|||||||
@ -2,16 +2,6 @@
|
|||||||
using Campofinale.Game.Entities;
|
using Campofinale.Game.Entities;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using MongoDB.Driver.Core.Clusters;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,17 +1,7 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Network;
|
||||||
using Campofinale.Network;
|
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,17 +1,7 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Network;
|
||||||
using Campofinale.Network;
|
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,21 +1,7 @@
|
|||||||
using BeyondTools.VFS.Crypto;
|
using Campofinale.Network;
|
||||||
using Campofinale.Network;
|
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using Google.Protobuf;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,15 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,16 +1,6 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
@ -26,6 +16,7 @@ namespace Campofinale.Packets.Cs
|
|||||||
if (character != null)
|
if (character != null)
|
||||||
{
|
{
|
||||||
character.potential=req.Level;
|
character.potential=req.Level;
|
||||||
|
|
||||||
//TODO consume Item ID
|
//TODO consume Item ID
|
||||||
|
|
||||||
ScCharPotentialUnlock unlock = new()
|
ScCharPotentialUnlock unlock = new()
|
||||||
|
|||||||
@ -1,16 +1,6 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Character;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,17 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
|
||||||
using Google.Protobuf;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
public class HandleCsGetMail
|
public class HandleCsGetMail
|
||||||
|
|||||||
17
Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs
Normal file
17
Campofinale/Packets/Cs/HandleCsItemBagAbandonInBag.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using Campofinale.Network;
|
||||||
|
using Campofinale.Protocol;
|
||||||
|
|
||||||
|
namespace Campofinale.Packets.Cs
|
||||||
|
{
|
||||||
|
public class HandleCsItemBagAbandonInBag
|
||||||
|
{
|
||||||
|
|
||||||
|
[Server.Handler(CsMsgId.CsItemBagAbandonInBag)]
|
||||||
|
public static void Handle(Player session, CsMsgId cmdId, Packet packet)
|
||||||
|
{
|
||||||
|
CsItemBagAbandonInBag req = packet.DecodeBody<CsItemBagAbandonInBag>();
|
||||||
|
session.inventoryManager.DropItemsBag(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs
Normal file
17
Campofinale/Packets/Cs/HandleCsItemBagMoveInBag.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using Campofinale.Network;
|
||||||
|
using Campofinale.Protocol;
|
||||||
|
|
||||||
|
namespace Campofinale.Packets.Cs
|
||||||
|
{
|
||||||
|
public class HandleCsItemBagMoveInBag
|
||||||
|
{
|
||||||
|
|
||||||
|
[Server.Handler(CsMsgId.CsItemBagMoveInBag)]
|
||||||
|
public static void Handle(Player session, CsMsgId cmdId, Packet packet)
|
||||||
|
{
|
||||||
|
CsItemBagMoveInBag req = packet.DecodeBody<CsItemBagMoveInBag>();
|
||||||
|
session.inventoryManager.items.MoveBagItem(req.FromGrid, req.ToGrid);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,17 +7,21 @@ using Campofinale.Protocol;
|
|||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
public class HandleCsLogin
|
public class HandleCsLogin
|
||||||
{
|
{
|
||||||
[Server.Handler(CsMsgId.CsCreateRole)]
|
[Server.Handler(CsMsgId.CsSetGender)]
|
||||||
public static void HandleCsCreateRole(Player session, CsMsgId cmdId, Packet packet)
|
public static void HandleCsSetGender(Player session, CsMsgId cmdId, Packet packet)
|
||||||
{
|
{
|
||||||
CsCreateRole req = packet.DecodeBody<CsCreateRole>();
|
CsSetGender req = packet.DecodeBody<CsSetGender>();
|
||||||
|
ScSetGender rsp = new()
|
||||||
|
{
|
||||||
|
Gender = req.Gender,
|
||||||
|
};
|
||||||
|
session.gender = rsp.Gender;
|
||||||
|
session.Send(ScMsgId.ScSetGender, rsp);
|
||||||
|
|
||||||
}
|
}
|
||||||
[Server.Handler(CsMsgId.CsLogin)]
|
[Server.Handler(CsMsgId.CsLogin)]
|
||||||
@ -53,7 +57,7 @@ namespace Campofinale.Packets.Cs
|
|||||||
// rsp.ServerPublicKey = ByteString.CopyFrom(encryptedEncKey);
|
// rsp.ServerPublicKey = ByteString.CopyFrom(encryptedEncKey);
|
||||||
|
|
||||||
CSChaCha20 cipher = new CSChaCha20(encKey, serverEncrypNonce, 1);
|
CSChaCha20 cipher = new CSChaCha20(encKey, serverEncrypNonce, 1);
|
||||||
if (req.ClientVersion == GameConstants.GAME_VERSION)
|
if (req.ClientVersion == GameConstants.GAME_VERSION || req.ClientVersion == GameConstants.GAME_VERSION_ANDROID)
|
||||||
{
|
{
|
||||||
if (account == null)
|
if (account == null)
|
||||||
{
|
{
|
||||||
@ -65,9 +69,18 @@ namespace Campofinale.Packets.Cs
|
|||||||
session.Disconnect();
|
session.Disconnect();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
session.Load(account.id);
|
bool exist=session.Load(account.id);
|
||||||
|
|
||||||
rsp.Uid = ""+session.accountId;
|
rsp.Uid = ""+session.accountId;
|
||||||
|
if (!exist)
|
||||||
|
{
|
||||||
|
rsp.IsFirstLogin = true;
|
||||||
|
//session.gender = Gender.GenInvalid;
|
||||||
|
|
||||||
|
//session.Send(ScMsgId.ScLogin, rsp);
|
||||||
|
//session.Send(new PacketScSyncBaseData(session));
|
||||||
|
//return;
|
||||||
|
}
|
||||||
session.Send(ScMsgId.ScLogin, rsp);
|
session.Send(ScMsgId.ScLogin, rsp);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -113,70 +126,131 @@ namespace Campofinale.Packets.Cs
|
|||||||
session.Send(new PacketScItemBagScopeSync(session, ItemValuableDepotType.SpecialItem));
|
session.Send(new PacketScItemBagScopeSync(session, ItemValuableDepotType.SpecialItem));
|
||||||
session.Send(new PacketScSyncAllMail(session));
|
session.Send(new PacketScSyncAllMail(session));
|
||||||
session.Send(new PacketScSceneCollectionSync(session));
|
session.Send(new PacketScSceneCollectionSync(session));
|
||||||
/*ScSyncAllMission missions = new()
|
string json1 = File.ReadAllText("44_ScSyncAllMission.json");
|
||||||
|
|
||||||
|
|
||||||
|
ScSyncAllMission m = Newtonsoft.Json.JsonConvert.DeserializeObject<ScSyncAllMission>(json1);
|
||||||
|
m.TrackMissionId = "";
|
||||||
|
|
||||||
|
//Disabled the hardcoded one and enable the missionSystem one
|
||||||
|
//session.Send(ScMsgId.ScSyncAllMission, session.missionSystem.ToProto());
|
||||||
|
session.Send(ScMsgId.ScSyncAllMission, m);
|
||||||
|
/*ession.Send(ScMsgId.ScSyncAllMission, new ScSyncAllMission()
|
||||||
{
|
{
|
||||||
|
NewMissionTags =
|
||||||
|
{
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
Missions =
|
Missions =
|
||||||
{
|
{
|
||||||
{"e0m0",
|
{"e0m0", new Mission()
|
||||||
new Mission()
|
{
|
||||||
|
MissionId="e0m0",
|
||||||
|
MissionState=(int)MissionState.Processing,
|
||||||
|
SucceedId=-1,
|
||||||
|
Properties =
|
||||||
{
|
{
|
||||||
MissionId="e0m0",
|
{1,new DynamicParameter()
|
||||||
MissionState=(int)MissionState.Processing,
|
|
||||||
Properties =
|
|
||||||
{
|
{
|
||||||
{1,new DynamicParameter()
|
RealType=1,
|
||||||
|
ValueType=1,
|
||||||
|
ValueBoolList =
|
||||||
{
|
{
|
||||||
ValueType=1,
|
false
|
||||||
RealType=1,
|
|
||||||
ValueBoolList =
|
|
||||||
{
|
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
} }
|
||||||
{2,new DynamicParameter()
|
|
||||||
{
|
|
||||||
ValueType=1,
|
|
||||||
RealType=1,
|
|
||||||
ValueBoolList =
|
|
||||||
{
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{3,new DynamicParameter()
|
|
||||||
{
|
|
||||||
ValueType=1,
|
|
||||||
RealType=1,
|
|
||||||
ValueBoolList =
|
|
||||||
{
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} }
|
||||||
},
|
},
|
||||||
TrackMissionId= "e0m0",
|
TrackMissionId = "e0m0",
|
||||||
|
|
||||||
CurQuests =
|
CurQuests =
|
||||||
{
|
{
|
||||||
{"e0m0#1", new Quest(){
|
|
||||||
QuestId="e0m0#1",
|
{"e0m0_q#1", new Quest()
|
||||||
QuestState=2,
|
{
|
||||||
|
QuestId="e0m0_q#1",
|
||||||
|
QuestState=(int)QuestState.Processing,
|
||||||
|
QuestObjectives =
|
||||||
|
{
|
||||||
|
new QuestObjective()
|
||||||
|
{
|
||||||
|
ConditionId="f6415b84",
|
||||||
|
|
||||||
|
IsComplete=false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{"e0m0_q#2", new Quest()
|
||||||
|
{
|
||||||
|
QuestId="e0m0_q#2",
|
||||||
|
QuestState=(int)QuestState.Available,
|
||||||
|
QuestObjectives =
|
||||||
|
{
|
||||||
|
new QuestObjective()
|
||||||
|
{
|
||||||
|
ConditionId="81736ca7",
|
||||||
|
IsComplete=false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{"e0m0_q#3", new Quest()
|
||||||
|
{
|
||||||
|
QuestId="e0m0_q#3",
|
||||||
|
QuestState=(int)QuestState.Available,
|
||||||
QuestObjectives =
|
QuestObjectives =
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}}
|
} },
|
||||||
}
|
{"e0m0_q#4", new Quest()
|
||||||
};*/
|
{
|
||||||
//session.Send(ScMessageId.ScSyncAllMission, missions);
|
QuestId="e0m0_q#4",
|
||||||
string json1 = File.ReadAllText("44_ScSyncAllMission.json");
|
QuestState=(int)QuestState.Available,
|
||||||
ScSyncAllMission m = Newtonsoft.Json.JsonConvert.DeserializeObject<ScSyncAllMission>(json1);
|
QuestObjectives =
|
||||||
m.TrackMissionId = "";
|
{
|
||||||
session.Send(ScMsgId.ScSyncAllMission, m);
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{"e0m0_q#5", new Quest()
|
||||||
|
{
|
||||||
|
QuestId="e0m0_q#5",
|
||||||
|
QuestState=(int)QuestState.Available,
|
||||||
|
QuestObjectives =
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{"e0m0_q#6", new Quest()
|
||||||
|
{
|
||||||
|
QuestId="e0m0_q#6",
|
||||||
|
QuestState=(int)QuestState.Available,
|
||||||
|
QuestObjectives =
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{"e0m0_q#7", new Quest()
|
||||||
|
{
|
||||||
|
QuestId="e0m0_q#7",
|
||||||
|
QuestState=(int)QuestState.Available,
|
||||||
|
QuestObjectives =
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
{"e0m0_q#8", new Quest()
|
||||||
|
{
|
||||||
|
QuestId="e0m0_q#8",
|
||||||
|
QuestState=(int)QuestState.Available,
|
||||||
|
QuestObjectives =
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
} }
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
|
||||||
session.Send(new PacketScGachaSync(session));
|
session.Send(new PacketScGachaSync(session));
|
||||||
ScSettlementSyncAll settlements = new ScSettlementSyncAll()
|
ScSettlementSyncAll settlements = new ScSettlementSyncAll()
|
||||||
@ -232,7 +306,7 @@ namespace Campofinale.Packets.Cs
|
|||||||
session.Send(new PacketScSpaceshipSync(session));
|
session.Send(new PacketScSpaceshipSync(session));
|
||||||
session.Send(new PacketScSyncFullDungeonStatus(session));
|
session.Send(new PacketScSyncFullDungeonStatus(session));
|
||||||
session.Send(new PacketScActivitySync(session));
|
session.Send(new PacketScActivitySync(session));
|
||||||
|
session.Send(new PacketScSnsGetChatList(session));
|
||||||
session.Send(ScMsgId.ScSyncFullDataEnd, new ScSyncFullDataEnd());
|
session.Send(ScMsgId.ScSyncFullDataEnd, new ScSyncFullDataEnd());
|
||||||
session.EnterScene();
|
session.EnterScene();
|
||||||
session.Initialized = true;
|
session.Initialized = true;
|
||||||
|
|||||||
@ -1,14 +1,9 @@
|
|||||||
using Campofinale.Network;
|
using System.Drawing;
|
||||||
|
|
||||||
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
using Pastel;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
@ -39,8 +34,9 @@ namespace Campofinale.Packets.Cs
|
|||||||
};
|
};
|
||||||
if (Server.config.logOptions.packets)
|
if (Server.config.logOptions.packets)
|
||||||
{
|
{
|
||||||
Logger.Print("CmdId: " + (CsMsgId)packet.csHead.Msgid);
|
Logger.Print("Recieved Packet: " + ((CsMsgId)packet.csHead.Msgid).ToString().Pastel(Color.LightCyan) + $" Id: {packet.csHead.Msgid} with {packet.finishedBody.Length} Bytes");
|
||||||
Logger.Print(BitConverter.ToString(packet.finishedBody).Replace("-", string.Empty).ToLower());
|
if (Server.config.logOptions.packetBodies)
|
||||||
|
Logger.Print(BitConverter.ToString(packet.finishedBody).Replace("-", string.Empty).ToLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Game.Entities;
|
using Campofinale.Game.Entities;
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,18 +1,8 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Entities;
|
||||||
using Campofinale.Game.Entities;
|
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
|
|||||||
@ -1,16 +1,6 @@
|
|||||||
using Campofinale.Game.Character;
|
using Campofinale.Game.Entities;
|
||||||
using Campofinale.Game.Entities;
|
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,21 +1,8 @@
|
|||||||
using BeyondTools.VFS.Crypto;
|
using Campofinale.Network;
|
||||||
using Campofinale.Network;
|
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Campofinale.Resource;
|
using Campofinale.Resource;
|
||||||
using Google.Protobuf;
|
|
||||||
using Google.Protobuf.WellKnownTypes;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
using static System.Net.Mime.MediaTypeNames;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
@ -31,11 +18,11 @@ namespace Campofinale.Packets.Cs
|
|||||||
session.sceneManager.LoadCurrentTeamEntities();
|
session.sceneManager.LoadCurrentTeamEntities();
|
||||||
session.sceneManager.LoadCurrent();
|
session.sceneManager.LoadCurrent();
|
||||||
session.LoadFinish = true;
|
session.LoadFinish = true;
|
||||||
/*session.Send(ScMessageId.ScSceneClientIdInfo, new ScSceneClientIdInfo()
|
session.Send(ScMsgId.ScSceneClientIdInfo, new ScSceneClientIdInfo()
|
||||||
{
|
{
|
||||||
RoleIdx = (uint)session.roleId,
|
RoleIdx = (uint)session.roleId,
|
||||||
LastMaxIdx = session.random.usedGuids.Max()
|
LastMaxIdx = session.random.usedGuids.Max()
|
||||||
});*/
|
});
|
||||||
if (session.curSceneNumId == 98)
|
if (session.curSceneNumId == 98)
|
||||||
{
|
{
|
||||||
session.Send(new PacketScSyncGameMode(session, "spaceship"));
|
session.Send(new PacketScSyncGameMode(session, "spaceship"));
|
||||||
|
|||||||
@ -1,14 +1,5 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
|
|||||||
@ -1,16 +1,5 @@
|
|||||||
using Campofinale.Game;
|
using Campofinale.Network;
|
||||||
using Campofinale.Network;
|
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
204
Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs
Normal file
204
Campofinale/Packets/Cs/HandleCsSceneSetLevelScriptActive.cs
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
using Campofinale.Game.Character;
|
||||||
|
using Campofinale.Game.Entities;
|
||||||
|
using Campofinale.Network;
|
||||||
|
using Campofinale.Protocol;
|
||||||
|
using Campofinale.Resource;
|
||||||
|
using Campofinale.Resource.Table;
|
||||||
|
using Pastel;
|
||||||
|
|
||||||
|
namespace Campofinale.Packets.Cs
|
||||||
|
{
|
||||||
|
public class HandleCsSceneSetLevelScriptActive
|
||||||
|
{
|
||||||
|
[Server.Handler(CsMsgId.CsSceneSetLevelScriptActive)]
|
||||||
|
public static void Handle(Player session, CsMsgId cmdId, Packet packet)
|
||||||
|
{
|
||||||
|
CsSceneSetLevelScriptActive req = packet.DecodeBody<CsSceneSetLevelScriptActive>();
|
||||||
|
if (req.IsActive)
|
||||||
|
{
|
||||||
|
|
||||||
|
ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify()
|
||||||
|
{
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
|
State = 3
|
||||||
|
};
|
||||||
|
session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Server.Handler(CsMsgId.CsSceneSetLevelScriptStart)]
|
||||||
|
public static void HandleCsSceneSetLevelScriptStart(Player session, CsMsgId cmdId, Packet packet)
|
||||||
|
{
|
||||||
|
CsSceneSetLevelScriptStart req = packet.DecodeBody<CsSceneSetLevelScriptStart>();
|
||||||
|
if (req.IsStart)
|
||||||
|
{
|
||||||
|
ScSceneLevelScriptStateNotify rsp = new ScSceneLevelScriptStateNotify()
|
||||||
|
{
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
|
State = 4
|
||||||
|
};
|
||||||
|
session.Send(ScMsgId.ScSceneLevelScriptStateNotify, rsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ExecuteEventAction(Player player, ScriptAction action)
|
||||||
|
{
|
||||||
|
switch (action.action)
|
||||||
|
{
|
||||||
|
case ScriptActionType.CompleteQuest:
|
||||||
|
player.missionSystem.CompleteQuest(action.valueStr[0]);
|
||||||
|
break;
|
||||||
|
case ScriptActionType.ProcessQuest:
|
||||||
|
player.missionSystem.ProcessQuest(action.valueStr[0]);
|
||||||
|
break;
|
||||||
|
case ScriptActionType.SpawnEnemy:
|
||||||
|
player.sceneManager.GetCurScene().SpawnEnemy(action.valueUlong[0]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Logger.PrintWarn("Script Action not implemented");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[Server.Handler(CsMsgId.CsSceneLevelScriptEventTrigger)]
|
||||||
|
public static void HandleCsSceneLevelScriptEventTrigger(Player session, CsMsgId cmdId, Packet packet)
|
||||||
|
{
|
||||||
|
|
||||||
|
CsSceneLevelScriptEventTrigger req = packet.DecodeBody<CsSceneLevelScriptEventTrigger>();
|
||||||
|
Logger.Print(req.Properties.ToString());
|
||||||
|
|
||||||
|
if (ResourceManager.levelScriptsEvents.TryGetValue(req.EventName, out LevelScriptEvent levelScriptEvent))
|
||||||
|
{
|
||||||
|
Logger.Print($"Event {req.EventName.Pastel(ConsoleColor.Yellow)} Executed.");
|
||||||
|
Logger.Print($"{levelScriptEvent.comment}");
|
||||||
|
levelScriptEvent.actions.ForEach(a =>
|
||||||
|
{
|
||||||
|
ExecuteEventAction(session, a);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.PrintWarn($"Event {req.EventName.Pastel(ConsoleColor.White)} is NOT implemented. INFO: [");
|
||||||
|
Logger.PrintWarn($" Scene: {req.SceneNumId.ToString().Pastel(ConsoleColor.White)}, Pos: {session.position.ToProto().ToString()} ");
|
||||||
|
Logger.PrintWarn($" ScriptID: {req.ScriptId.ToString().Pastel(ConsoleColor.White)} ");
|
||||||
|
Logger.PrintWarn($"]");
|
||||||
|
}
|
||||||
|
/*if(req.EventName== "#8777e316")
|
||||||
|
{
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#1",
|
||||||
|
QuestState = (int)QuestState.Completed,
|
||||||
|
});
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#2",
|
||||||
|
QuestState = (int)QuestState.Processing,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(req.EventName== "#6ea2690d")
|
||||||
|
{
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#2",
|
||||||
|
QuestState = (int)QuestState.Completed,
|
||||||
|
});
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#3",
|
||||||
|
QuestState = (int)QuestState.Processing,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (req.EventName == "#bb79de30")
|
||||||
|
{
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#3",
|
||||||
|
QuestState = (int)QuestState.Completed,
|
||||||
|
});
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#4",
|
||||||
|
QuestState = (int)QuestState.Processing,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (req.EventName == "#4c76ec3c")
|
||||||
|
{
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#4",
|
||||||
|
QuestState = (int)QuestState.Completed,
|
||||||
|
});
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#5",
|
||||||
|
QuestState = (int)QuestState.Processing,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (req.EventName == "#251df3ad")
|
||||||
|
{
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#5",
|
||||||
|
QuestState = (int)QuestState.Completed,
|
||||||
|
});
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#6",
|
||||||
|
QuestState = (int)QuestState.Processing,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (req.EventName == "#e6ac322b")
|
||||||
|
{
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#6",
|
||||||
|
QuestState = (int)QuestState.Completed,
|
||||||
|
});
|
||||||
|
session.Send(ScMsgId.ScQuestStateUpdate, new ScQuestStateUpdate()
|
||||||
|
{
|
||||||
|
QuestId = "e0m0_q#7",
|
||||||
|
QuestState = (int)QuestState.Processing,
|
||||||
|
});
|
||||||
|
}*/
|
||||||
|
|
||||||
|
ScSceneUpdateLevelScriptProperty update1 = new()
|
||||||
|
{
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
|
};
|
||||||
|
session.Send(ScMsgId.ScSceneUpdateLevelScriptProperty, update1);
|
||||||
|
ScSceneTriggerClientLevelScriptEvent trigger = new()
|
||||||
|
{
|
||||||
|
EventName = req.EventName,
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
|
};
|
||||||
|
session.Send(ScMsgId.ScSceneTriggerClientLevelScriptEvent, trigger);
|
||||||
|
ScSceneUpdateLevelScriptProperty update2 = new()
|
||||||
|
{
|
||||||
|
SceneNumId = req.SceneNumId,
|
||||||
|
ScriptId = req.ScriptId,
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
session.Send(ScMsgId.ScSceneUpdateLevelScriptProperty, update2);
|
||||||
|
ScSceneLevelScriptEventTrigger rsp = new ScSceneLevelScriptEventTrigger()
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
session.Send(ScMsgId.ScSceneLevelScriptEventTrigger, rsp,packet.csHead.UpSeqid);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,16 +1,6 @@
|
|||||||
using Campofinale.Game;
|
using Campofinale.Game.Entities;
|
||||||
using Campofinale.Game.Entities;
|
|
||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using static Campofinale.Resource.ResourceManager;
|
using static Campofinale.Resource.ResourceManager;
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
@ -22,7 +12,12 @@ namespace Campofinale.Packets.Cs
|
|||||||
public static void Handle(Player session, CsMsgId cmdId, Packet packet)
|
public static void Handle(Player session, CsMsgId cmdId, Packet packet)
|
||||||
{
|
{
|
||||||
CsSceneSetSafeZone req = packet.DecodeBody<CsSceneSetSafeZone>();
|
CsSceneSetSafeZone req = packet.DecodeBody<CsSceneSetSafeZone>();
|
||||||
|
ScSceneSetSafeZone rsp = new()
|
||||||
|
{
|
||||||
|
Id = req.Id,
|
||||||
|
InZone = req.InZone,
|
||||||
|
};
|
||||||
|
session.Send(ScMsgId.ScSceneSetSafeZone, rsp);
|
||||||
if (req.InZone)
|
if (req.InZone)
|
||||||
{
|
{
|
||||||
var entity = session.sceneManager.GetEntity(req.Id) as EntityInteractive;
|
var entity = session.sceneManager.GetEntity(req.Id) as EntityInteractive;
|
||||||
|
|||||||
@ -1,15 +1,6 @@
|
|||||||
using Campofinale.Network;
|
using Campofinale.Network;
|
||||||
using Campofinale.Packets.Sc;
|
using Campofinale.Packets.Sc;
|
||||||
using Campofinale.Protocol;
|
using Campofinale.Protocol;
|
||||||
using Google.Protobuf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Campofinale.Packets.Cs
|
namespace Campofinale.Packets.Cs
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user