Example #1
0
 protected void HandleGravityChanged(object sender, EventArgs e)
 {
     if (Map != null)
     {
         Map.Constants.Gravity = BZDatabase.GetValueF(BZDBVarNames.Gravity);
     }
 }
Example #2
0
        protected void PackInitalBZDB(ServerPlayer player)
        {
            int size = 0;

            bool sentOne = false;

            Dictionary <string, string> currentList = new Dictionary <string, string>();

            foreach (var item in BZDatabase.GetVars())
            {
                int thisSize = item.Key.Length + item.RawValue.Length + 2;
                if (thisSize + size >= 512)
                {
                    sentOne = true;
                    player.SendMessage(new MsgSetVars(currentList));
                    currentList.Clear();
                    size = 0;
                }
                currentList.Add(item.Key, item.RawValue);
                size += thisSize;
            }

            if (!sentOne || currentList.Count > 0)
            {
                player.SendMessage(new MsgSetVars(currentList));
            }
        }
Example #3
0
 protected void PreDispatchChecks(NetworkMessage msg)
 {
     if (!InitalSetVarsFinished && InitalSetVarsStarted && msg.Code != MsgSetVars.CodeValue)
     {
         InitalSetVarsFinished = true;
         BZDatabase.FinishLoading();
     }
 }