project/Refactoring: Difference between revisions

From OpenKore Wiki
Jump to navigation Jump to search
No edit summary
m (Category: Development)
Line 58: Line 58:
$devotionList (source×target): ActorPlayerList inside sourceActor
$devotionList (source×target): ActorPlayerList inside sourceActor
</pre>
</pre>
[[Category:Development]]

Revision as of 02:03, 16 May 2010

Possible improvements.

Globals.pm

Move everything what makes a sense to Actors, ActorLists and new modules and wrap $messageSender->sendEverything to Actor/ActorList/etc methods.

Account-related

@chars $char
$accountID $sessionID $sessionID2 $accountSex $accountSex2 ...
$net $messageSender $charServer $conState $captcha_state ...
@ai_seq @ai_seq_args %ai_v $AI $AI_forcedOff ...

other permanent (not cleaned on relog) or out of mapserver or general connection-related stuff

=> new object $account->{...}

Next step:

=> list of accounts? (multiple bots per OK instance)

Character-related

%friends, @friendsID: ActorPlayerList $char->{friends}
$currentChatRoom: $char->{chatroom} link to chatroom in chatrooms list
@skillsID (list of character skills): $char->{skillsID} (already implemented for slaves; rename {slave_skillsID} to {skillsID}, too)
%guild (guild player list, ally/enemy guild list, guild info): ActorPlayerList $char->{guild}
%currentDeal (two item lists, info)
%shop, @articles, @venderListsID (our shop item list, shop info; another player's shop): ActorItemList $char->{shop}; ActorItemList $playerActor->{shop}

%cart (item list with cart info): ActorItemList $char->{cart}
%storage, @storageID (storage item list with storage info): ActorItemList $char->{storage}
$hotkeyList: ???
$questList: ???
$mailList (list of mail messages): new object, mail message

@cardMergeItemsID, $cardMergeIndex: ActorItemList $char->{something}
@arrowCraftID (list of possible items to use on): ActorItemList $char->{something}
@identifyID (list of possible items to use on): ActorItemList $char->{something}
$repairList (list of possible items to use on): ActorItemList $char->{something}
$cookingList: ActorItemList $char->{something}
  * these can also be just properties of inventory items

other character-binded temp. stuff and info: $char->{something}

Environment related

%targetTimeout (target×skill timeout): targetActor->{something}
%chatRooms, @chatRoomsID, @currentChatRoomUsers (list of chatrooms, list of players in current): new object: Chatroom, with ActorPlayerList inside
@storeList (npc store): ActorItemList $actorNpc->{store}
@cashList (list of items in npc cash store): ActorItemList $actorNpc->{something}
%spells, @spellsID
$auctionList (list of auction entries): ???
$devotionList (source×target): ActorPlayerList inside sourceActor