HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: Login to the custom area or _PlayerAccount class cast  (Read 978 times)

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Login to the custom area or _PlayerAccount class cast
« on: Jan 13, 13, 09:56:22 AM »

Hello.

I want after character selection logon to the custom area. Selected on the Select Character Screen.

So what i was done. I created code copyed from _cssLoadInCleanTest.

I created new field on my DM_PlayerAccount. But when i try to set this field on the server side:

Code: [Select]
unique method cssSetLoadInTestArea( account as NodeRef of Class _PlayerAccount, loadTest as Boolean )
  println("cssSetLoadInTestArea")
  where account
    is kindof DM_PlayerAccount
      println("cssSetLoadInTestArea::loadTest")
      account.dmLoadInTestArea = loadTest
    .
  .
.

This code "is kindof DM_PlayerAccount" never TRUE. Why? I have the class DM_PlayerAccount parent class set to the _PlayerAccount in what place i must say to use DM_PlayerAccoutn class?


If i Rigth understande I need the system tell that my playeraccount class is DM_PlayerAccount. But in what place i must do this?
« Last Edit: Jan 13, 13, 10:12:37 AM by Grogard »
Logged

AlderonGames

  • World Owners
  • ****
  • Posts: 20
    • View Profile
Re: Login to the custom area or _PlayerAccount class cast
« Reply #1 on: Jan 13, 13, 10:25:29 AM »

You need to create a prototype of your new account class and destroy your account root node. Then override a the function that specifies what prototype to create accounts under. There are examples of other people creating custom account classes / prototypes on the forums.

You can check what type of class your account root node was created using /HEINFO CharacterName or Account ID.

For Example from my project in the $ACCOUNT system node on the server.

Code: [Select]
untrusted method VerifyAccount()
  account as NodeRef of Class _PlayerAccount= SYSTEM.REMOTE.CLIENT
  if not (account is kindof ROTDA_PlayerAccount)
    KickPlayer(account, "Invalid Account, Restart Heroblade.","Destroying Account Node because it isn't ROTDA_PlayerAccount.")
    $ACCOUNT._DestroyAccountRootNode(account)
   
  .
.

method HE_UsePrototypeForAccountRootNode( prototypeName references String ) as Boolean
  //prototypeName = "e_account_prototype"
  prototypeName = "ROTDA_AccountPrototype"
  return true
.


Thanks,
Matthew
« Last Edit: Jan 13, 13, 10:32:15 AM by AlderonGames »
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Login to the custom area or _PlayerAccount class cast
« Reply #2 on: Jan 13, 13, 10:58:35 AM »

Thanks.

But i try to do this:
"20:50:07: /CPFC "DM_PlayerAccount", "DM_Account_Prototype"; description="prototype from which account nodes are created."
20:50:07: System:CLI command /CPFC "DM_PlayerAccount", "DM_Account_Prototype"; description="prototype from which account nodes are created.".
20:50:07: System:CPFC OK 1000001569 : "Created Prototype ID: 1000001569"
20:50:19: /qp DM_PlayerAccount
20:50:19: System:CLI command /qp DM_PlayerAccount.
20:50:19: System:QP LISTBEGIN 0 : "Prototype ID, Name, Description: "
QP LISTELEMENT 0 : "ID="1000001569" NAME="DM_Account_Prototype" DESCRIPTION="prototype from which account nodes are created.""
QP LISTEND 0 : "End of Prototypes""

But this is only in the console. How create server prototype from my class? $( Can you decribe in details. In the forum there is only global not in details $(
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Login to the custom area or _PlayerAccount class cast
« Reply #3 on: Jan 14, 13, 01:37:38 AM »

How to create Server prototype from class pernament for DM_PlayerAccount class for example?
Logged

Grogard

  • World Owners
  • ****
  • Posts: 36
    • View Profile
Re: Login to the custom area or _PlayerAccount class cast
« Reply #4 on: Jan 14, 13, 01:38:54 AM »

You need to create a prototype of your new account class and destroy your account root node.

How can i do this?
Logged