private int getCurrentWinStreakToday(IMMOItem sfsItem)
 {
     if (sfsItem.ContainsVariable(SocketItemVars.INTEGER_A.GetKey()))
     {
         return(sfsItem.GetVariable(SocketItemVars.INTEGER_A.GetKey()).GetIntValue());
     }
     return(0);
 }
 public override void UpdateData(User user, List <string> changedVars, IMMOItem item)
 {
     if (item != null && _bullets.ContainsKey(item.Id))
     {
         float x = 0; float y = 0;
         if (item.ContainsVariable(Consts.X))
         {
             x = (float)item.GetVariable(Consts.X).GetIntValue();
         }
         if (item.ContainsVariable(Consts.Y))
         {
             y = (float)item.GetVariable(Consts.Y).GetIntValue();
         }
         _bullets[item.Id].SetPosition(new Vector2(x, y));
     }
     base.UpdateData(user, changedVars, item);
 }
 private int getBestWinStreakToday(IMMOItem sfsItem)
 {
     if (sfsItem.ContainsVariable(SocketItemVars.ACTION_COUNT.GetKey()))
     {
         return(sfsItem.GetVariable(SocketItemVars.ACTION_COUNT.GetKey()).GetIntValue());
     }
     return(0);
 }
 private string getPath(IMMOItem sfsItem)
 {
     if (sfsItem.ContainsVariable(SocketItemVars.GAME_OBJECT_PATH.GetKey()))
     {
         return(sfsItem.GetVariable(SocketItemVars.GAME_OBJECT_PATH.GetKey()).GetStringValue());
     }
     return(string.Empty);
 }
 public IslandTargetGroupMMOItem(IMMOItem sfsItem)
 {
     Path    = sfsItem.GetVariable(SocketItemVars.GAME_OBJECT_PATH.GetKey()).GetStringValue();
     Expires = long.Parse(sfsItem.GetVariable(SocketItemVars.STATE_TIMESTAMP.GetKey()).GetStringValue());
     if (sfsItem.ContainsVariable(SocketItemVars.TIMESTAMP.GetKey()))
     {
         Starts = long.Parse(sfsItem.GetVariable(SocketItemVars.TIMESTAMP.GetKey()).GetStringValue());
     }
 }
Beispiel #6
0
    private string getTurnOutcomeDanceMoveData(IMMOItem sfsItem)
    {
        string result = string.Empty;

        if (sfsItem.ContainsVariable(SocketItemVars.DANCE_MOVE_DATA.GetKey()))
        {
            result = sfsItem.GetVariable(SocketItemVars.DANCE_MOVE_DATA.GetKey()).GetStringValue();
        }
        return(result);
    }
Beispiel #7
0
    private string getTurnData(IMMOItem sfsItem)
    {
        string result = string.Empty;

        if (sfsItem.ContainsVariable(SocketItemVars.TURN_DATA.GetKey()))
        {
            result = sfsItem.GetVariable(SocketItemVars.TURN_DATA.GetKey()).GetStringValue();
        }
        return(result);
    }
Beispiel #8
0
        private int getGameTemplateId(IMMOItem sfsItem)
        {
            int result = 0;

            if (sfsItem.ContainsVariable(SocketItemVars.INTEGER_A.GetKey()))
            {
                result = sfsItem.GetVariable(SocketItemVars.INTEGER_A.GetKey()).GetIntValue();
            }
            return(result);
        }
Beispiel #9
0
        private long getTimeToLiveInSeconds(IMMOItem sfsItem)
        {
            long result = 0L;

            if (sfsItem.ContainsVariable(SocketItemVars.TIME_TO_LIVE.GetKey()))
            {
                result = sfsItem.GetVariable(SocketItemVars.TIME_TO_LIVE.GetKey()).GetIntValue();
            }
            return(result);
        }
Beispiel #10
0
        private long getTimeStartedInSecondsSinceEpoc(IMMOItem sfsItem)
        {
            long result = 0L;

            if (sfsItem.ContainsVariable(SocketItemVars.STATE_TIMESTAMP.GetKey()))
            {
                result = long.Parse(sfsItem.GetVariable(SocketItemVars.STATE_TIMESTAMP.GetKey()).GetStringValue());
            }
            return(result);
        }
 public override void Add(User user, IMMOItem item)
 {
     if (item != null && !_bullets.ContainsKey(item.Id))
     {
         // check type var contain inside item or not
         if (item.ContainsVariable(Consts.TYPE))
         {   // check type is bullet
             if (item.GetVariable(Consts.TYPE).GetIntValue() == Consts.ES_BULLET)
             {
                 if (item.ContainsVariable(Consts.X) && item.ContainsVariable(Consts.Y))
                 {
                     _bullets.Add(item.Id, new Bullet((float)item.GetVariable(Consts.X).GetIntValue(),
                                                      (float)item.GetVariable(Consts.Y).GetIntValue(),
                                                      (ulong)item.Id));
                     _bullets[item.Id].LoadContents(_contents);
                     Debug.WriteLine("Added bullet " + item.Id);
                 }
             }
         }
     }
     base.Add(user, item);
 }
Beispiel #12
0
 public override void Add(User user, IMMOItem item)
 {
     if (item != null && !_items.ContainsKey(item.Id))
     {
         // check type var contain inside item or not
         if (item.ContainsVariable(Consts.TYPE))
         {   // check type is bullet
             int type = item.GetVariable(Consts.TYPE).GetIntValue();
             if (type == Consts.ES_ITEM_ARMOR || type == Consts.ES_ITEM_ISVISIABLE || type == Consts.ES_ITEM_FREZZE)
             {
                 if (item.ContainsVariable(Consts.X) && item.ContainsVariable(Consts.Y))
                 {
                     _items.Add(item.Id, new Item((float)item.GetVariable(Consts.X).GetIntValue(),
                                                  (float)item.GetVariable(Consts.Y).GetIntValue(),
                                                  type));
                     _items[item.Id].LoadContents(_contents);
                 }
             }
         }
     }
     base.Add(user, item);
 }
Beispiel #13
0
 public override void UpdateData(User user, List <string> changedVars, IMMOItem item)
 {
     if (item != null && _items.ContainsKey(item.Id))
     {
         if (item.ContainsVariable(Consts.TYPE))
         {
             int type = item.GetVariable(Consts.TYPE).GetIntValue();
             if (type == Consts.ES_ITEM_FREZZE ||
                 type == Consts.ES_ITEM_ARMOR ||
                 type == Consts.ES_ITEM_ISVISIABLE)
             {
                 if (item.ContainsVariable(Consts.COUNT_DOWN))
                 {
                     bool isCountDown = item.GetVariable(Consts.COUNT_DOWN).GetBoolValue();
                     if (isCountDown)
                     {
                         _items[item.Id].Behavior(Consts.COUNT_DOWN);
                     }
                 }
             }
         }
     }
     base.UpdateData(user, changedVars, item);
 }