ItemHelper.cs 954 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using GFGGame;
  3. namespace ET
  4. {
  5. public static class ItemHelper
  6. {
  7. public static async ETTask<int> GetItemAttributeInfos()
  8. {
  9. M2C_GetItemAttributeInfos m2C_GetItemAttributeInfos = null;
  10. Session session = null;
  11. try
  12. {
  13. session = GameGlobal.zoneScene.GetComponent<SessionComponent>().Session;
  14. m2C_GetItemAttributeInfos = (M2C_GetItemAttributeInfos)await session.Call(new C2M_GetItemAttributeInfos());
  15. }
  16. catch(Exception e)
  17. {
  18. return ErrorCode.ERR_NetWorkError;
  19. }
  20. if(m2C_GetItemAttributeInfos.Error != ErrorCode.ERR_Success)
  21. {
  22. return m2C_GetItemAttributeInfos.Error;
  23. }
  24. ItemDataManager.InitServerDataItemAttribute(m2C_GetItemAttributeInfos.ItemAtrributes);
  25. return ErrorCode.ERR_Success;
  26. }
  27. }
  28. }