Asp.Net API script

For discussion of the Poker Mavens server module and other administration topics
Post Reply
Erkan
Posts: 49
Joined: Mon Aug 15, 2011 11:19 am
Location: Amsterdam

Asp.Net API script

Post by Erkan »

Hi,

Does anyone have asp.net api scripts like the sample's that Kent have on his site?

Erkan.
rjones33
Posts: 98
Joined: Tue Jun 24, 2008 6:51 pm
Location: Warrenville, SC
Contact:

Re: Asp.Net API script

Post by rjones33 »

Erkan,

I do all my programming in asp.net/vb.net. What specifically are you looking for?
Erkan
Posts: 49
Joined: Mon Aug 15, 2011 11:19 am
Location: Amsterdam

Re: Asp.Net API script

Post by Erkan »

I also do some programming in asp.net Vb but I am not a pro.
Just wondering how the API scripts Kent made in PHP look in VB so I can learn to make my own
scripts.

Regards,

Erkan.
Erkan
Posts: 49
Joined: Mon Aug 15, 2011 11:19 am
Location: Amsterdam

Re: Asp.Net API script

Post by Erkan »

Can some give me a automated login API scrip for PM.
The same as Kent has in PHP but I want it in Asp.Net / VB.

Thanks.
slawek
Posts: 18
Joined: Fri Feb 13, 2009 2:56 pm

Re: Asp.Net API script

Post by slawek »

That API libarary was created a while ago. Not all functions was implemented, just part of them for own needs.
Not sure if that works with current version of PM, but at least can direct you how to implement that with VB.NET.

To use that script:

Code: Select all

Private Const pokerAPIURL As String = "http://ipaddess:8087/api?"
Private Const pokerAPIPassword As String = "password"
Dim Results As String = ""
Dim pmAPI As New pokerAPI.PokerAPI(pokerAPIURL, pokerAPIPassword)
------------------------------------------------------------------------------------------
Public Sub examplesub(ByVal mUserName As String, ByVal mUserPassword As String)

        Results = ""

        Dim mData As New Hashtable

        Dim mPokerPlayer As New pokerAPI.pokerPlayer

        mPokerPlayer.Player = mUserName
        mPokerPlayer.PW = mUserPassword

        mData = mAPI.AccountsGet(mUserName)

       If mData("Result") = "Ok" Then

            'if user exist. then just update some data for user


            mData = mAPI.AccountsEdit(mUserName)

        Else

          'user not exist. create account
         
            mData = mAPI.AccountsAdd("playername")


        End If
       If mData("Result") <> "Ok" Then
        'for some reason can't create account
         Results =mData("Error")
          Exit Sub

       end if
       
       'we are cool. or user exist or just created.
       ' refresh user's data
        mData = mAPI.AccountsGet("playername") 
        Dim Balance as long
        Balance = mData("Balance")

       ' if user's balance less then 1000 chips increase it to 20000 chips
         
        If Balance <= 10000 Then

            mData = mAPI.AccountsIncBalance(mUserName, 20000)

        End If
       If mData("Result") <> "Ok" Then
          'error with balance increase
         Results =mData("Error")
         Exit Sub
       endif

End Sub

Attachments
PMVBAPI.zip
API library
(2.73 KiB) Downloaded 427 times
Post Reply