The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling functions
Author Message
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Calling functions
What actually changes is the type of the SRC object and default object (I).
So if you call a function from an item, the SRC object and the default object (I) references an item type, if you call from a character the SRC and default references to a character type .

The type means what default proprerties/function (like STR for a character) can be accessed from both SRC and the default object (I).
In your case the LIST command is a "global" command and can be used in a function that is called by items,characters and server object.

I am also sure that when calling a function from the server object, both SRC and default object are set to the server object only when the function is launched from the console.

Example:
[FUNCTION test]
log <name> <src.name>
serv.log <name> <src.name>

If this function is launched from the console the results will be:
1st line) Myshardname Myshardname
2nd line) Myshardname Myshardname

If this function is launched in game by typing .test the results will be:
1st line) An error, because log isn't accessible by a character type
2nd line) Myshardname, Charactername

If this function is launched in game by typing .serv.test the results will be:
1st line) Myshardname, CharacterName
2nd line) Myshardname, CharacterName

Even if you typed .serv.test the source object that called the function is still a character.
(This post was last modified: 08-20-2015 08:38 PM by darksun84.)
08-20-2015 08:38 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Calling functions - hctez - 08-20-2015, 11:17 AM
RE: Calling functions - darksun84 - 08-20-2015 08:38 PM
RE: Calling functions - hctez - 08-21-2015, 05:02 AM
RE: Calling functions - darksun84 - 08-21-2015, 05:10 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)