mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-18 17:27:50 -05:00
Rebuilt swf/ajclient.swf from swf-src (tools/build-client.sh). New patched
classes: KeepAlive, AvatarView, AvatarUtility, Item, DenItemHelper,
SitForwardAction.
Custom items
- The Item Maker in Settings, in the game's own style: make an item from one
of the game's, name it, upload a picture (PNG encoded in the client and
shrunk when too big), choose sticker or texture, rename, delete.
- Pictures stand in for the item's icon and, for den items, the placed item.
- Worn pictures: LayerBitmap paints a sticker or a texture. Fixed it showing
only until the player moved:
- AvatarView rebuilt the worn layers on every new animation without the
item id, so walking drew the base item. It now carries the id ("d").
- Frames painted while the picture loaded stayed cached as the base item.
They are all painted again when it arrives (LayerBitmap.artArrived).
- The picture loader checks the server's crossdomain policy before its pixels
are read.
Chat
- Windows emoji and the AJ emotes inline with text in chat bubbles; emoji are
sent as \{hex} tags. An emoji picker and :shortcodes:.
- Chat box limit 200 characters; the box shows emoji in the system font.
- Clicking an emote while typing puts its code in the chat box.
- Two new base emotes: 💀 and 😭 (HUDAssets.swf, EmoticonUtility).
- Typing bubble: a "..." over a player's animal while they type ("xty").
It goes on a new line, when they stop, or after 8 seconds.
- loadArt shares pictures by address: emoji and icons load and decode once.
Actions
- Sit Front and Sit Back between the sit arrows, plus Mirror for any action
(from the other session). Front now plays animation 5 (facing the camera)
and Back animation 1 (facing away); both had played animation 1.
Staff
- The Moderate window from a player card's Report button for staff: warn
(custom text too), kick, silence, ban, summon, goto, notes.
- Invisible staff drawn half see-through; staff land on the exact spot on
goto and summon ("xgt").
Other
- AFK sign-out after 75 minutes instead of 7, with a 60-second warning
(com.sbi.client.KeepAlive).
- Jam-a-Grams show custom items and colours; Jammer Wall avatar photos fixed.
- The Item Maker row in the settings menu and the item window toggle.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
178 lines
5.7 KiB
ActionScript
178 lines
5.7 KiB
ActionScript
package com.sbi.client
|
|
{
|
|
import com.sbi.popup.SBOkPopup;
|
|
import flash.display.DisplayObject;
|
|
import flash.display.DisplayObjectContainer;
|
|
import flash.events.Event;
|
|
import flash.events.MouseEvent;
|
|
import flash.events.TimerEvent;
|
|
import flash.utils.Timer;
|
|
import localization.LocalizationManager;
|
|
|
|
public class KeepAlive
|
|
{
|
|
|
|
// how long a player may be away before the game signs them out: an
|
|
// hour and a quarter (the game's own was 7 minutes). the server's
|
|
// socket waits longer still (config.idleTimeoutMs).
|
|
private static var KICK_INTERVAL:int = 4500000;
|
|
|
|
private static var SEND_MSG_INTERVAL:int = 180000;
|
|
|
|
private static var NOTIFY_USER_INTERVAL:int = 10000;
|
|
|
|
private static var NOTIFY_USER_TIME:int = 60000;
|
|
|
|
public static var popupLayer:DisplayObjectContainer;
|
|
|
|
private static var _keepAliveTimer:Timer;
|
|
|
|
private static var _timeLeftTimer:Timer;
|
|
|
|
private static var _bInputReceived:Boolean;
|
|
|
|
private static var _mcsToKeepAlive:Array;
|
|
|
|
private static var _lastMsgSentToServer:Number;
|
|
|
|
private static var _inputTimer:Timer;
|
|
|
|
private static var _kickWarningPopupShowing:Boolean;
|
|
|
|
private static var _isConnected:Function;
|
|
|
|
private static var _disconnectClient:Function;
|
|
|
|
private static var _playIdleWarningSound:Function;
|
|
|
|
public function KeepAlive()
|
|
{
|
|
super();
|
|
}
|
|
|
|
public static function init(param1:DisplayObjectContainer, param2:Function, param3:Function = null, param4:Function = null) : void
|
|
{
|
|
popupLayer = param1;
|
|
_keepAliveTimer = new Timer(SEND_MSG_INTERVAL);
|
|
_keepAliveTimer.addEventListener("timer",sendKeepAliveMsg);
|
|
_timeLeftTimer = new Timer(NOTIFY_USER_INTERVAL);
|
|
_timeLeftTimer.addEventListener("timer",timeLeftTimer);
|
|
_timeLeftTimer.start();
|
|
_lastMsgSentToServer = new Date().getTime();
|
|
_mcsToKeepAlive = [];
|
|
_isConnected = param2;
|
|
_disconnectClient = param3;
|
|
_playIdleWarningSound = param4;
|
|
}
|
|
|
|
public static function startKATimer(param1:DisplayObjectContainer) : void
|
|
{
|
|
param1.addEventListener("mouseDown",inputReceivedHandler,false,0,true);
|
|
param1.addEventListener("keyDown",inputReceivedHandler,false,0,true);
|
|
_mcsToKeepAlive.push(param1);
|
|
_bInputReceived = true;
|
|
sendKeepAliveMsg(null);
|
|
_keepAliveTimer.start();
|
|
}
|
|
|
|
public static function stopKATimer(param1:DisplayObjectContainer) : void
|
|
{
|
|
var _loc2_:int = 0;
|
|
gMainFrame.server.setXtObject_Str("ka",[],gMainFrame.server.isWorldZone);
|
|
_keepAliveTimer.stop();
|
|
_loc2_ = 0;
|
|
while(_loc2_ < _mcsToKeepAlive.length)
|
|
{
|
|
if(_mcsToKeepAlive[_loc2_] == param1)
|
|
{
|
|
_mcsToKeepAlive[_loc2_].removeEventListener("mouseDown",inputReceivedHandler);
|
|
_mcsToKeepAlive[_loc2_].removeEventListener("keyDown",inputReceivedHandler);
|
|
_mcsToKeepAlive.splice(_loc2_,1);
|
|
break;
|
|
}
|
|
_loc2_++;
|
|
}
|
|
}
|
|
|
|
public static function restartTimeLeftTimer() : void
|
|
{
|
|
if(_timeLeftTimer)
|
|
{
|
|
_lastMsgSentToServer = new Date().getTime();
|
|
_timeLeftTimer.stop();
|
|
_timeLeftTimer.start();
|
|
}
|
|
}
|
|
|
|
public static function sendKeepAliveReset() : void
|
|
{
|
|
_bInputReceived = true;
|
|
sendKeepAliveMsg(null);
|
|
}
|
|
|
|
private static function sendKeepAliveMsg(param1:TimerEvent) : void
|
|
{
|
|
if(_bInputReceived)
|
|
{
|
|
gMainFrame.server.setXtObject_Str("ka",[],gMainFrame.server.isWorldZone);
|
|
_lastMsgSentToServer = new Date().getTime();
|
|
_bInputReceived = false;
|
|
}
|
|
}
|
|
|
|
private static function timeLeftTimer(param1:TimerEvent) : void
|
|
{
|
|
var _loc2_:DisplayObject = null;
|
|
var _loc3_:Number = new Date().getTime() - _lastMsgSentToServer;
|
|
if(!_kickWarningPopupShowing && _loc3_ > KICK_INTERVAL - NOTIFY_USER_TIME)
|
|
{
|
|
_loc2_ = new SBOkPopup(popupLayer,LocalizationManager.translateIdOnly(14681),true,onKickWarningPopup);
|
|
_kickWarningPopupShowing = true;
|
|
if(_playIdleWarningSound != null)
|
|
{
|
|
_playIdleWarningSound();
|
|
}
|
|
if((gMainFrame.userInfo.isModerator || gMainFrame.clientInfo.accountType == 4) && !gMainFrame.server.isBlueboxMode())
|
|
{
|
|
_bInputReceived = true;
|
|
sendKeepAliveMsg(null);
|
|
_kickWarningPopupShowing = false;
|
|
SBOkPopup.destroyInParentChain(_loc2_);
|
|
}
|
|
}
|
|
if(_loc3_ > KICK_INTERVAL)
|
|
{
|
|
if(_isConnected())
|
|
{
|
|
if(_disconnectClient != null)
|
|
{
|
|
_disconnectClient();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private static function onKickWarningPopup(param1:MouseEvent) : void
|
|
{
|
|
_bInputReceived = true;
|
|
sendKeepAliveMsg(null);
|
|
param1.stopPropagation();
|
|
SBOkPopup.destroyInParentChain(param1.target.parent);
|
|
_kickWarningPopupShowing = false;
|
|
}
|
|
|
|
public static function inputReceivedHandler(param1:Event) : void
|
|
{
|
|
if(!_bInputReceived)
|
|
{
|
|
_bInputReceived = true;
|
|
}
|
|
if(new Date().getTime() - _lastMsgSentToServer > SEND_MSG_INTERVAL)
|
|
{
|
|
sendKeepAliveMsg(null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|