General

Index

Interface
Side
Description
InitLingmienAetherModServer[Required] Register Lingmien Aether module information
BindNextTickFunctionBoth EndsBind a function to execute on the next tick, can carry parameters required by the function, and resubmitting within the same tick won鈥檛 take effect
BindNextTickFunctionAboutUUIDBoth EndsBind a function to execute on the next tick, can carry parameters required by the function
SetIsDisableServerServer setting, need to be called directly after server initialization
GetServerIsDisableClientGet server configuration information
AddObjectFunctionClientAdd a function library to the instance
GetLingmienAetherManifestClientGet the Lingmien Aether function library manifest
NotifyBoth EndsCommunication between both ends
UseServerApiClientUse server interfaces
UseClientApiServerUse client interfaces, but cannot obtain return values
GetIsStartClientGet whether the player is in the game entry state (i.e., whether they clicked "Single Player" after entering the Lingmien Aether main interface)
BindGameHighTickFunctionClientBind a high tick function for the game
BindMouseWheelFunctionClientBind mouse wheel event
LerpClientGeneral nonlinear calculation
SLerpClientAngular nonlinear calculation
GetLingmienAetherModServerGet registered Lingmien Aether module data
GetTwoPosLengthBoth EndsGet the distance between the target coordinates and the first coordinates
DeltaDateTimeBoth EndsCalculate the date difference, FirstDate - SecondDate
SplitListByQuantityBoth EndsSplit a list by quantity
SortListByNumberMagnitudeBoth EndsSort a list of Dict elements by numbers -- [{}, {}, ...]
SortDictByNumberMagnitudeBoth EndsSort a dict that consists of Dict elements by numbers -- {'x':{}, 'y':{}, ...}
GetDictExtremeValueKeyBoth EndsGet the extreme value corresponding key of a specified key in a Dict -- {'x':float, 'y':float, ...}
GetPlatFormServerGet the server's runtime environment
ConvertUnicodeDictToUtf8Both EndsConvert Unicode encoding in a dictionary to UTF-8 encoding
EncryptDictServerEncrypt data into a string
DecryptDictServerDecrypt data

InitLingmienAetherMod

Server

  • Description
    [Required] Register Lingmien Aether module information

  • Parameters

Parameter NameData TypeDescription
ModDatadictModule information
  • Return Value
    None

  • Remarks
    ModData(dict) Description

Parameter NameData TypeDescription
ModNamestrModule name
VersionstrModule version number
LogoPathstrLogo path, starting from textures (optional)
ContentstrModule introduction

Effect Image:

  • Example
def __init__(self, namespace, systemName):
  ...
  self.LA = self.GetLASys('Your key here')

@Event.ClientEvent('UiInitFinished')
def UiInitFinished(self, *args):
  ModData = {
      'ModName': 'Lingmien Aether',
      'Version': '1.0.2',
      'LogoPath': 'textures/ui/LA/logo_text',
      'Content': 'Lingmien Aether'
                  '\nVersion: 1.0.2'
                  '\nDevelopers: Da Fei Mian Development Team\n'
                  '\nLAAPI Mod Manager',
  }
  self.LA.UseServerApi('InitLingmienAetherMod', [ModData])

BindNextTickFunction

Both Ends

  • Description
    Bind a function to execute on the next tick, can carry parameters required by the function; resubmitting within the same tick won鈥檛 take effect.

  • Parameters

Parameter NameData TypeDescription
FunctionInstancefunctionFunction, e.g. self.CreateMsg, do not write it as self.CreateMsg()
*argsanyParameters for the bound function
  • Return Value
    None

  • Remarks
    None

  • Example None


BindNextTickFunctionAboutUUID

Both Ends

  • Description
    Bind a function to execute on the next tick, can carry parameters required by the function.

  • Parameters

Parameter NameData TypeDescription
FunctionInstancefunctionFunction, e.g. self.CreateMsg, do not write it as self.CreateMsg()
*argsanyParameters for the bound function
  • Return Value
    None

  • Remarks
    None

  • Example None


SetIsDisable

Server

  • Description
    Server setting, needs to be called directly after server initialization.

  • Parameters

Parameter NameData TypeDescription
TypestrSetting type
BoolboolWhether to enable, default is None
  • Return Value
    The boolean value of the setting (bool)

  • Remarks

    • Setting Types:
    Parameter NameData TypeDefault ValueDescription
    AntiCheatUseServerApiboolTrueAnti-cheat for the online lobby and network game using UseServerApi
    AntiCheatPingboolTrueAnti-cheat for weak networks in the online lobby and network game
    IsStartUIboolTrueWhether to enable the Lingmien Aether main interface; disabling this will invalidate related interfaces and functions
    IsLobbyboolAutoWhether it is an online lobby or network game environment
    IsLobbyKickboolFalseWhether to restrict players from re-entering this room/record
  • Example

def __init__(self, namespace, systemName):
    ...
    self.LA = self.GetLASys('Your key here')
    self.LA.SetIsDisable('IsStartUI', False)

GetServerIsDisable

Client

  • Description
    Get server configuration information.

  • Parameters

Parameter NameData TypeDescription
TypestrSetting type

AddObjectFunction

Client

  • Description
    Add a function library to the instance.

  • Parameters

Parameter NameData TypeDescription
ManifestlistFunction library manifest
  • Return Value
    None

  • Remarks

def QuerySet(Value):
  pass

Manifest = [
  ('QuerySet', QuerySet, False, None, None),
  ...
]

Explanation of tuple

Parameter PositionData TypeDescription
0strName of the function after addition
1functionThe function itself after addition
2boolWhether it has a decorator (deprecated, please write as False)
3objectListener decorator (deprecated, please write as None)
4strEvent name (deprecated, please write as None)
  • Example None

GetLingmienAetherManifest

Client

  • Description
    Get the Lingmien Aether function library manifest.

  • Parameters
    None

  • Return Value
    Lingmien Aether function library manifest (list)

  • Remarks
    Allows direct use of some interfaces in a non-Lingmien Aether client instance; types that require round-trip support between both ends usually are not supported.

  • Example

self.LA = self.GetLASys('Your key here')
LingmienAetherManifest = self.LA.GetLingmienAetherManifest()
self.AddObjectFunction(LingmienAetherManifest)

Notify

Both Ends

  • Description
    Server Usage: Communication from the server to client events using the Lingmien Aether engine.

    Client Usage: Communication from the client to server events using the Lingmien Aether engine.

  • Server Parameters

Parameter NameData TypeDescription
LAConfigobjectLingmien Aether script configuration config, used to specify communication for the script system
ClientFunctionNamestrThe function name of the client system in this Lingmien Aether script configuration
DataDictdictCommunication data
PlayerIdListstr, list, NoneList of clients for the communication; defaults to None for broadcasting to all players
DelayTimefloatHow long to delay on failure in communication to the client (in seconds); defaults to None for retrying in the next frame
  • Client Parameters
Parameter NameData TypeDescription
LAConfigobjectLingmien Aether script configuration config, used to specify communication for the script system
ServerFunctionNamestrThe function name of the server system in this Lingmien Aether script configuration
DataDictdictCommunication data
  • Return Value
    None

  • Remarks
    This interface automatically optimizes communication efficiency, saving bandwidth.

  • Example Broadcasting from server to client

Server Sending

LASystem.Notify(config, 'CustomFunction', {'a': 1})

Client Receiving

def CustomFunction(self, args):
  print(args)
  # Result will be {'a': 1}

UseServerApi

Client

  • Description
    Use server interfaces but cannot obtain return values.

  • Parameters

Parameter NameData TypeDescription
ApiNamestrServer interface name
ArgsListlistList of server interface parameters
OnlyClientboolWhether to only call cached data on the client; defaults to False
  • Return Value
    ApiId, used to get return values from the interface (str)

  • Remarks

    • This interface is prohibited for execution in online lobbies and network games!
    • It is recommended to enable OnlyClient when handling large amounts of return data.
  • Example

self.LA = self.GetLASys('Your key here')
ApiId = self.LA.UseServerApi('PlaySound', [playerId, 'random.click'])
# Consider player latency, to avoid not being able to get return values
ApiId = self.LA.UseServerApi('GetItemDictByInv', [playerId, 0, 0])
Ping = self.LA.GetPlayerPing(playerId)
# Since the ping is in milliseconds, use a 0.02 multiplier timer to obtain it
compTimer.AddTimer(0.02 * Ping, self.CallBack, ApiId)

def CallBack(self, ApiId):
  # Get the return value
  self.LA.GetModRenderAttrByKey(playerId, ApiId)

UseClientApi

Server

  • Description
    Use client interfaces but cannot obtain return values.

  • Parameters

Parameter NameData TypeDescription
ApiNamestrClient interface name
ArgsListlistList of client interface parameters
PlayerIdstrSpecify client player Id; defaults to None to broadcast to all clients using this interface
  • Return Value
    None

  • Remarks
    None

  • Example None


GetIsStart

Client

  • Description
    Get whether the player is in the game entry state (i.e., whether they clicked "Single Player" after entering the Lingmien Aether main interface).

  • Parameters
    None

  • Return Value
    Whether the player is in the game entry state (bool)

  • Remarks
    None

  • Example None


BindGameHighTickFunction

Client

  • Description
    Bind a high tick function for the game.

  • Parameters

Parameter NameData TypeDescription
FunctionInstancefunctionFunction (no parameters), e.g., self.CreateMsg, do not write it as self.CreateMsg()
IsAddboolWhether it is adding binding; defaults to True, indicating an addition, otherwise a removal
  • Return Value
    None

  • Remarks
    The original MC is 20 ticks per second, while the NetEase MC script is 30 ticks per second; this tick is based on the player's current FPS.

  • Example

def __init__(self, namespace, systemName):
  ...
  self.LA = self.GetLASys('Your key here')

@Event.ClientEvent('UiInitFinished')
def UiInitFinished(self, *args):
  self.LA.BindGameHighTickFunction(self.CreateMsg)

def CreateMsg(self):
  self.LA.Msg('High refresh tick')

BindMouseWheelFunction

Client

  • Description
    Bind mouse wheel event.

  • Parameters

Parameter NameData TypeDescription
FunctionInstancefunctionFunction (with a bool parameter indicating whether it is scrolling up); e.g., self.CreateMsg, do not write it as self.CreateMsg()
IsAddboolWhether it is adding binding; defaults to True, indicating an addition, otherwise a removal
  • Return Value
    None

  • Remarks
    None

  • Example None


Lerp

Client

  • Description
    General nonlinear calculation.

  • Parameters

Parameter NameData TypeDescription
StartfloatStarting value
EndfloatEnding value
FactorfloatNonlinear coefficient
  • Return Value
    Result after linear interpolation (float)

  • Remarks
    None

  • Example None


SLerp

Client

  • Description
    Angular nonlinear calculation.

  • Parameters

Parameter NameData TypeDescription
StartfloatStarting angle
EndfloatEnding angle
FactorfloatNonlinear coefficient
  • Return Value
    Result after linear interpolation (float)

  • Remarks
    None

  • Example None


GetLingmienAetherMod

Server

  • Description
    Get registered Lingmien Aether module data.

  • Parameters
    None

  • Return Value
    Lingmien Aether module data (dict)

  • Remarks
    None

  • Example None


GetTwoPosLength

Both Ends

  • Description
    Get the distance between the target coordinates and the first coordinates.

  • Parameters

Parameter NameData TypeDescription
FirstPostupleFirst 3D coordinates
TargetPostupleTarget 3D coordinates
  • Return Value
    Distance (float)

  • Remarks
    None

  • Example None


DeltaDateTime

Both Ends

  • Description
    Calculate the date difference, FirstDate - SecondDate.

  • Parameters

Parameter NameData TypeDescription
FirstDatestrFormat: %Y-%m-%d %H:%M:%S
SecondDatestrFormat: %Y-%m-%d %H:%M:%S
  • Return Value
    Difference (datetime), <type 'datetime.timedelta'>

  • Remarks
    None

  • Example None


SplitListByQuantity

Both Ends

  • Description
    Split a list by quantity.

  • Parameters

Parameter NameData TypeDescription
ListlistList to be split
NumberintNumber of elements per new variable
  • Return Value
    List after processing (list)

  • Remarks
    None

  • Example None


SortListByNumberMagnitude

Both Ends

  • Description
    Sort a list of Dict elements by numbers -- [{}, {}, ...].

  • Parameters

Parameter NameData TypeDescription
ListlistList to be sorted
KeystrWhich key in the list to sort by; fill none if not applicable
IsPositiveSequenceboolWhether it is in ascending order
  • Return Value
    List after processing (list)

  • Remarks
    None

  • Example None


SortDictByNumberMagnitude

Both Ends

  • Description
    Sort a dict consisting of Dict elements by numbers -- {'x':{}, 'y':{}, ...}.

  • Parameters

Parameter NameData TypeDescription
DictdictDict to be sorted
KeystrKey in the Dict to sort by
IsPositiveSequenceboolWhether it is in ascending order
NumintHow many to sort out
  • Return Value
    List of dict after processing (list)

  • Remarks
    None

  • Example None


GetDictExtremeValueKey

Both Ends

  • Description
    Get the extreme value corresponding key of a specified key in a Dict -- {'x':float, 'y':float, ...}.

  • Parameters

Parameter NameData TypeDescription
DictdictDict to be accessed
KeystrTarget key for comparison; the value of this key in the dict will be compared
FindMaxboolWhether to look for the maximum value; defaults to True
  • Return Value
    Corresponding key of extreme value (any)

  • Remarks
    None

  • Example None


GetPlatForm

Server

  • Description
    Get the server's runtime environment.

  • Parameters
    None

  • Return Value
    Runtime environment: 0 for Windows; 1 for iOS; 2 for Android; -1 for others, such as online lobbies, Apollo, and other Linux servers (int)

  • Remarks
    None

  • Example None


ConvertUnicodeDictToUtf8

Both Ends

  • Description
    Convert Unicode encoding in a dictionary to UTF-8 encoding.

  • Parameters

Parameter NameData TypeDescription
UnicodeDictdictInput dictionary
  • Return Value
    Converted dictionary (dict)

  • Remarks
    None

  • Example None


EncryptDict

Server

  • Description
    Encrypt data into a string.

  • Parameters

Parameter NameData TypeDescription
DataanyData
  • Return Value
    Encrypted string (str)

  • Remarks
    None

  • Example

Data = {
  'Name': 'Minecraft'
}
LASecret = LASystem.Secret()
SecretData = LASecret.EncryptDict(Data)
print(LASecret.DecryptDict(SecretData))

DecryptDict

Server

  • Description
    Decrypt data.

  • Parameters

Parameter NameData TypeDescription
PasswordstrString of encrypted data
  • Return Value
    Decrypted content, first being the date at encryption, second being the encrypted data (tuple[datetime, any])

  • Remarks
    None

  • Example

Data = {
  'Name': 'Minecraft'
}
LASecret = LASystem.Secret()
SecretData = LASecret.EncryptDict(Data)
print(LASecret.DecryptDict(SecretData))

Go to Attachments

评论交流

文档目录

灵免以太