ItemHelper.cs 995 B

123456789101112131415161718192021222324252627282930
  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. Log.Debug(e.ToString());
  19. return ErrorCode.ERR_NetWorkError;
  20. }
  21. if(m2C_GetItemAttributeInfos.Error != ErrorCode.ERR_Success)
  22. {
  23. return m2C_GetItemAttributeInfos.Error;
  24. }
  25. ItemDataManager.InitServerDataItemAttribute(m2C_GetItemAttributeInfos.ItemAtrributes);
  26. return ErrorCode.ERR_Success;
  27. }
  28. }
  29. }